summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Jarvis <ljjarvis@gmail.com>2014-11-19 12:41:16 +0000
committerLee Jarvis <ljjarvis@gmail.com>2014-11-19 12:41:16 +0000
commitc811bc2e28b2326b924c69abe2e4729508f482b5 (patch)
tree6ec2e948ad6e1eb89714f7bdd767c83c0414b5f0 /test
parentf8895c3d2f962340c99d3211d71c9bb60bf69f18 (diff)
downloadslop-c811bc2e28b2326b924c69abe2e4729508f482b5.tar.gz
Handle default values
Diffstat (limited to 'test')
-rw-r--r--test/result_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/result_test.rb b/test/result_test.rb
index d1406e1..68fd83f 100644
--- a/test/result_test.rb
+++ b/test/result_test.rb
@@ -16,6 +16,12 @@ describe Slop::Result do
assert_equal 2, @verbose.count
end
+ it "handles default values" do
+ @options.string("--foo", default: "bar")
+ @result.parser.reset.parse %w()
+ assert_equal "bar", @result[:foo]
+ end
+
describe "#[]" do
it "returns an options value" do
assert_equal "lee", @result["name"]