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!
119119 :boolean
120120 when Numeric
121121 :numeric
122+ when Symbol
123+ :string
122124 when Hash , Array , String
123125 @default . class . name . downcase . to_sym
124126 end
Original file line number Diff line number Diff line change @@ -141,6 +141,12 @@ def option(name, options = {})
141141 end . to raise_error ( ArgumentError , "An option's default must match its type." )
142142 end
143143
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+
144150 it "boolean options cannot be required" do
145151 expect do
146152 option ( "foo" , :required => true , :type => :boolean )
You can’t perform that action at this time.
0 commit comments