diff --git a/spec/base_spec.rb b/spec/base_spec.rb index 7ffef5fd..2208bce9 100644 --- a/spec/base_spec.rb +++ b/spec/base_spec.rb @@ -318,7 +318,7 @@ def hello end it "suggests commands that are similar if there is a typo" do - expected = "Could not find command \"paintz\" in \"barn\" namespace.\n" + expected = "Could not find command \"paintz\" in \"barn\" namespace.\n".dup expected << "Did you mean? \"paint\"\n" if Thor::Correctable expect(capture(:stderr) { Barn.start(%w(paintz)) }).to eq(expected) diff --git a/spec/parser/options_spec.rb b/spec/parser/options_spec.rb index 200a5d5f..d5c22ffb 100644 --- a/spec/parser/options_spec.rb +++ b/spec/parser/options_spec.rb @@ -117,7 +117,7 @@ def remaining create foo: "baz", bar: :required parse("--bar", "baz", "--baz", "unknown") - expected = "Unknown switches \"--baz\"" + expected = "Unknown switches \"--baz\"".dup expected << "\nDid you mean? \"--bar\"" if Thor::Correctable expect { check_unknown! }.to raise_error(Thor::UnknownArgumentError) do |error|