diff options
author | Lee Jarvis <lee@jarvis.co> | 2012-05-15 08:46:16 -0700 |
---|---|---|
committer | Lee Jarvis <lee@jarvis.co> | 2012-05-15 08:46:16 -0700 |
commit | 68d35f89e092d1ca12810b233b40d567b081c4dc (patch) | |
tree | 43205b22341c7d32472c3560db6c8a93922d1f1a | |
parent | cfd16f9d0c80cffe9753bb874e371879fdfed280 (diff) | |
parent | 8ae5ebba2c33cc56a0f231cda4bc71b19d664f85 (diff) | |
download | slop-68d35f89e092d1ca12810b233b40d567b081c4dc.tar.gz |
Merge pull request #64 from chsonnu/master
An explicit test for underscore support.
-rw-r--r-- | test/slop_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb index 023128e..66da016 100644 --- a/test/slop_test.rb +++ b/test/slop_test.rb @@ -263,6 +263,13 @@ class SlopTest < TestCase assert opts.foo_bar? end + test "supporting underscore" do + opts = Slop.new { on :foo_bar= } + opts.parse %w' --foo_bar baz ' + assert_equal 'baz', opts[:foo_bar] + assert opts.foo_bar? + end + test "parsing an optspec and building options" do optspec = <<-SPEC ruby foo.rb [options] |