Skip to content

Commit 6ae2fa1

Browse files
committed
Merge pull request #355 from athaeryn/consistency
More consistent punctuation
2 parents 19f95da + 9762483 commit 6ae2fa1

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

lib/thor/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,10 @@ def handle_no_command_error(command, has_namespace = $thor_runner) #:nodoc:
474474
alias handle_no_task_error handle_no_command_error
475475

476476
def handle_argument_error(command, error, args, arity) #:nodoc:
477-
msg = "ERROR: #{basename} #{command.name} was called with "
477+
msg = "ERROR: \"#{basename} #{command.name}\" was called with "
478478
msg << 'no arguments' if args.empty?
479479
msg << 'arguments ' << args.inspect if !args.empty?
480-
msg << "\nUsage: #{self.banner(command).inspect}."
480+
msg << "\nUsage: #{self.banner(command).inspect}"
481481
raise InvocationError, msg
482482
end
483483

spec/group_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
}
134134
}
135135
expect(content).to match(/invoke e/)
136-
expect(error).to match(/ERROR: thor two was called with arguments/)
136+
expect(error).to match(/ERROR: "thor two" was called with arguments/)
137137
end
138138

139139
it "shows invocation information to the user" do

spec/runner_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def when_no_thorfiles_exist
112112
it "does not swallow Thor InvocationError" do
113113
ARGV.replace ["my_script:animal"]
114114
content = capture(:stderr) { Thor::Runner.start }
115-
expect(content.strip).to eq(%Q'ERROR: thor animal was called with no arguments\nUsage: "thor my_script:animal TYPE".')
115+
expect(content.strip).to eq(%Q'ERROR: "thor animal" was called with no arguments\nUsage: "thor my_script:animal TYPE"')
116116
end
117117
end
118118

spec/thor_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,12 @@ def boring(*args)
259259
stderr = capture(:stderr) { Scripts::Arities.start(args) }
260260
expect(stderr.strip).to eq(msg)
261261
end
262-
arity_asserter.call ["zero_args", "one" ], %Q'ERROR: thor zero_args was called with arguments ["one"]\nUsage: "thor scripts:arities:zero_args".'
263-
arity_asserter.call ["one_arg" ], %Q'ERROR: thor one_arg was called with no arguments\nUsage: "thor scripts:arities:one_arg ARG".'
264-
arity_asserter.call ["one_arg", "one", "two" ], %Q'ERROR: thor one_arg was called with arguments ["one", "two"]\nUsage: "thor scripts:arities:one_arg ARG".'
265-
arity_asserter.call ["one_arg", "one", "two" ], %Q'ERROR: thor one_arg was called with arguments ["one", "two"]\nUsage: "thor scripts:arities:one_arg ARG".'
266-
arity_asserter.call ["two_args", "one" ], %Q'ERROR: thor two_args was called with arguments ["one"]\nUsage: "thor scripts:arities:two_args ARG1 ARG2".'
267-
arity_asserter.call ["optional_arg", "one", "two" ], %Q'ERROR: thor optional_arg was called with arguments ["one", "two"]\nUsage: "thor scripts:arities:optional_arg [ARG]".'
262+
arity_asserter.call ["zero_args", "one" ], %Q'ERROR: "thor zero_args" was called with arguments ["one"]\nUsage: "thor scripts:arities:zero_args"'
263+
arity_asserter.call ["one_arg" ], %Q'ERROR: "thor one_arg" was called with no arguments\nUsage: "thor scripts:arities:one_arg ARG"'
264+
arity_asserter.call ["one_arg", "one", "two" ], %Q'ERROR: "thor one_arg" was called with arguments ["one", "two"]\nUsage: "thor scripts:arities:one_arg ARG"'
265+
arity_asserter.call ["one_arg", "one", "two" ], %Q'ERROR: "thor one_arg" was called with arguments ["one", "two"]\nUsage: "thor scripts:arities:one_arg ARG"'
266+
arity_asserter.call ["two_args", "one" ], %Q'ERROR: "thor two_args" was called with arguments ["one"]\nUsage: "thor scripts:arities:two_args ARG1 ARG2"'
267+
arity_asserter.call ["optional_arg", "one", "two" ], %Q'ERROR: "thor optional_arg" was called with arguments ["one", "two"]\nUsage: "thor scripts:arities:optional_arg [ARG]"'
268268
end
269269

270270
it "raises an error if the invoked command does not exist" do

0 commit comments

Comments
 (0)