end
when 'string'
option.on("-#{cast[:short]}", "--#{cast[:long]} S", String) do |s|
- @options[cast[:long]] = s.to_sym # TODO: this to_sym - is that needed?
+ @options[cast[:long]] = s
end
when REGEX_LIST
option.on( "-#{cast[:short]}", "--#{cast[:long]} A", Array) do |a|
argv = ["--foo", "bleh", "-I", DUMMY_FILE]
casts = [{:long=>"foo", :short=>"f", :type=>"string", :mandatory=>false, :default=>"bar", :allowed=>nil, :disallowed=>nil}]
options = Biopieces.options_parse(argv, casts, SCRIPT_PATH)
- assert_equal(options[:foo], "bleh".to_sym)
+ assert_equal(options[:foo], "bleh")
end
def test_Biopieces_options_parse_with_mandatory_cast_and_no_argument_raises