diff options
author | Lee Jarvis <leejarvis@fastmail.com> | 2016-08-21 14:50:59 +0100 |
---|---|---|
committer | Lee Jarvis <leejarvis@fastmail.com> | 2016-08-21 14:50:59 +0100 |
commit | 219efec879bcac72d3f422c347d70525980df7ea (patch) | |
tree | d6bcb355d5fa63c29fe36047256cc0e13c026a57 /test | |
parent | f6552e8ada471452100f1ce13913fdcc8032a7e0 (diff) | |
download | slop-219efec879bcac72d3f422c347d70525980df7ea.tar.gz |
Handle bad constant names in Slop.option_defined?
Closes #198
Diffstat (limited to 'test')
-rw-r--r-- | test/slop_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/slop_test.rb b/test/slop_test.rb new file mode 100644 index 0000000..f6fb408 --- /dev/null +++ b/test/slop_test.rb @@ -0,0 +1,17 @@ +require "test_helper" + +describe Slop do + describe ".option_defined?" do + it "handles bad constant names" do + assert_equal false, Slop.option_defined?("Foo?Bar") + end + + it "returns false if the option is not defined" do + assert_equal false, Slop.option_defined?("Foo") + end + + it "returns true if the option is defined" do + assert_equal true, Slop.option_defined?("String") + end + end +end |