diff options
author | chuck son <chsonnu@gmail.com> | 2012-05-14 12:09:00 -0400 |
---|---|---|
committer | chuck son <chsonnu@gmail.com> | 2012-05-14 12:09:00 -0400 |
commit | 8ae5ebba2c33cc56a0f231cda4bc71b19d664f85 (patch) | |
tree | 43205b22341c7d32472c3560db6c8a93922d1f1a /test/slop_test.rb | |
parent | cfd16f9d0c80cffe9753bb874e371879fdfed280 (diff) | |
download | slop-8ae5ebba2c33cc56a0f231cda4bc71b19d664f85.tar.gz |
an explicit test for underscore support
Diffstat (limited to 'test/slop_test.rb')
-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] |