Skip to content

Commit

Permalink
tests for rails#250
Browse files Browse the repository at this point in the history
  • Loading branch information
gutenye committed Sep 8, 2012
1 parent e3fbd24 commit 39dc2ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/thor/base.rb
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions spec/fixtures/script.thor
Expand Up @@ -93,6 +93,11 @@ END
end
end

desc "send", "send as a task name"
def send
true
end

private

def method_missing(meth, *args)
Expand Down
4 changes: 4 additions & 0 deletions spec/thor_spec.rb
Expand Up @@ -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.