diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2013-01-06 14:36:27 +0000 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2013-01-06 14:36:27 +0000 |
commit | 301677e4ccc335c9b5eaaf14dc99e9c3baf3c483 (patch) | |
tree | 3b8b7adaa52fc0477d080ce8a0d84d1035182e83 /test | |
parent | 8a8760099fdf7808c62549d1aafe59c5a09dd35d (diff) | |
download | slop-301677e4ccc335c9b5eaaf14dc99e9c3baf3c483.tar.gz |
implement Slop#run method
Diffstat (limited to 'test')
-rw-r--r-- | test/slop_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb index 7a65af2..42433b1 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -431,4 +431,18 @@ class SlopTest < TestCase end end + test "adding a runner" do + orun = proc { |r| assert_instance_of Slop, r } + arun = proc { |r| assert_equal ['foo', 'bar'], r } + + opts = Slop.parse(%w'foo --foo bar -v bar') do + on :v + on :foo= + run do |opts, argv| + orun[opts] + arun[argv] + end + end + end + end |