We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8c4c7a commit 6124f01Copy full SHA for 6124f01
lib/thor.rb
@@ -314,7 +314,7 @@ def stop_on_unknown_option!(*command_names)
314
end
315
316
def stop_on_unknown_option?(command) #:nodoc:
317
- !!@stop_on_unknown_option && @stop_on_unknown_option.include?(command.name.to_sym)
+ command && !@stop_on_unknown_option.nil? && @stop_on_unknown_option.include?(command.name.to_sym)
318
319
320
protected
spec/thor_spec.rb
@@ -153,6 +153,10 @@ def boring(*args)
153
expect(klass.stop_on_unknown_option?(mock :name => "baz")).to be_false
154
155
156
+
157
+ it "doesn't break new" do
158
+ expect(my_script.new).to be_a(Thor)
159
+ end
160
161
162
describe "#map" do
0 commit comments