summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2013-08-29 15:21:18 +0100
committerLee Jarvis <ljjarvis@gmail.com>2013-08-29 15:21:18 +0100
commit04174ed89697a15af6d0942252b1232d7e816e3d (patch)
tree5f87a58594075a0b046f6472a8eb6120fe888985 /test
parenta1ee2866e2a350515992efd5a8da18109d5d9f3a (diff)
downloadslop-04174ed89697a15af6d0942252b1232d7e816e3d.tar.gz
Added Command#process
Diffstat (limited to 'test')
-rw-r--r--test/command_test.rb12
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)