diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2013-08-29 15:21:18 +0100 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2013-08-29 15:21:18 +0100 |
commit | 04174ed89697a15af6d0942252b1232d7e816e3d (patch) | |
tree | 5f87a58594075a0b046f6472a8eb6120fe888985 /test | |
parent | a1ee2866e2a350515992efd5a8da18109d5d9f3a (diff) | |
download | slop-04174ed89697a15af6d0942252b1232d7e816e3d.tar.gz |
Added Command#process
Diffstat (limited to 'test')
-rw-r--r-- | test/command_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/command_test.rb b/test/command_test.rb index 6924305..abe4b4f 100644 --- a/test/command_test.rb +++ b/test/command_test.rb @@ -32,6 +32,18 @@ class CommandTest < TestCase assert_kind_of Slop::Command, @command.commands[:add] end + test "parse with runner" do + run = nil + options :foo, :bar + @command.process do |command, args| + run = 1 + assert command.is_a?(Slop::Command) + assert_equal ['foo', 'bar'], args + end + parse %w[foo bar] + assert_equal 1, run + end + test "[]" do option "user=" parse %w(--user Lee) |