From 22e0e6e52f502493c00443a60c73809cfea539ff Mon Sep 17 00:00:00 2001 From: Joe Gracyk Date: Mon, 10 May 2021 14:07:05 -0700 Subject: Add simple tests for StringOption --- test/types_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/types_test.rb b/test/types_test.rb index ed13d5c..a45302a 100644 --- a/test/types_test.rb +++ b/test/types_test.rb @@ -1,5 +1,19 @@ require 'test_helper' +describe Slop::StringOption do + before do + @options = Slop::Options.new + @age = @options.string "--name" + @minus = @options.string "--zipcode" + @result = @options.parse %w(--name Foo --zipcode 12345) + end + + it "returns the value as a string" do + assert_equal "Foo", @result[:name] + assert_equal "12345", @result[:zipcode] + end +end + describe Slop::SymbolOption do before do @options = Slop::Options.new -- cgit v1.2.1