Permalink
Browse files

tests for #250

  • Loading branch information...
1 parent e3fbd24 commit 39dc2bafcb739039e673fb07653ddce919a870f2 @gutenye committed Sep 8, 2012
Showing with 10 additions and 1 deletion.
  1. +1 −1 lib/thor/base.rb
  2. +5 −0 spec/fixtures/script.thor
  3. +4 −0 spec/thor_spec.rb
View
@@ -74,7 +74,7 @@ def initialize(args=[], options={}, config={})
to_parse += opts.remaining unless self.class.strict_args_position?(config)
thor_args = Thor::Arguments.new(self.class.arguments)
- thor_args.parse(to_parse).each { |k,v| send("#{k}=", v) }
+ thor_args.parse(to_parse).each { |k,v| __send__("#{k}=", v) }
@args = thor_args.remaining
end
@@ -93,6 +93,11 @@ END
end
end
+ desc "send", "send as a task name"
+ def send
+ true
+ end
+
private
def method_missing(meth, *args)
View
@@ -414,5 +414,9 @@ def unknown(*args)
klass.start(["unknown", "--bar", "baz"]).should == []
klass.start(["unknown", "foo", "--bar", "baz"]).should == ["foo"]
end
+
+ it "send as a task name" do
+ MyScript.start(["send"]).should == true
+ end
end
end

0 comments on commit 39dc2ba

Please sign in to comment.