File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ def validate_default_type!
119
119
:boolean
120
120
when Numeric
121
121
:numeric
122
+ when Symbol
123
+ :string
122
124
when Hash , Array , String
123
125
@default . class . name . downcase . to_sym
124
126
end
Original file line number Diff line number Diff line change @@ -141,6 +141,12 @@ def option(name, options = {})
141
141
end . to raise_error ( ArgumentError , "An option's default must match its type." )
142
142
end
143
143
144
+ it "does not raises an error if default is an symbol and type string" do
145
+ expect do
146
+ option = option ( "foo" , :type => :string , :default => :bar )
147
+ end . not_to raise_error
148
+ end
149
+
144
150
it "boolean options cannot be required" do
145
151
expect do
146
152
option ( "foo" , :required => true , :type => :boolean )
You can’t perform that action at this time.
0 commit comments