diff options
author | Lee Jarvis <ljjarvis@gmail.com> | 2014-11-19 09:26:41 +0000 |
---|---|---|
committer | Lee Jarvis <ljjarvis@gmail.com> | 2014-11-19 09:26:41 +0000 |
commit | 63d1212fd21e783912cc158e4decae5c6c94642c (patch) | |
tree | 6cd227929ebdabccc59184b0d40c3cfcb20c4340 /test/result_test.rb | |
parent | 253dcd9622328d5f7a5a695c3bf487b65565fb9e (diff) | |
download | slop-63d1212fd21e783912cc158e4decae5c6c94642c.tar.gz |
Add Result#to_hash
Diffstat (limited to 'test/result_test.rb')
-rw-r--r-- | test/result_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/result_test.rb b/test/result_test.rb new file mode 100644 index 0000000..719978b --- /dev/null +++ b/test/result_test.rb @@ -0,0 +1,18 @@ +require 'test_helper' + +describe Slop::Result do + before do + @options = Slop::Options.new + @options.bool "-v", "--verbose" + @options.string "--name" + @options.string "--unused" + + @result = @options.parse %w(foo -v --name lee argument) + end + + describe "#to_hash" do + it "returns option keys and values" do + assert_equal({ verbose: true, name: "lee", unused: nil }, @result.to_hash) + end + end +end |