File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ def validate_default_type!
116116 when nil
117117 return
118118 when TrueClass , FalseClass
119- :boolean
119+ required? ? :string : :boolean
120120 when Numeric
121121 :numeric
122122 when Symbol
Original file line number Diff line number Diff line change @@ -153,6 +153,12 @@ def option(name, options = {})
153153 end . to raise_error ( ArgumentError , "An option cannot be boolean and required." )
154154 end
155155
156+ it "does not raises an error if default is a boolean and it is required" do
157+ expect do
158+ option ( "foo" , :required => true , :default => true )
159+ end . not_to raise_error
160+ end
161+
156162 it "allows type predicates" do
157163 expect ( parse ( :foo , :string ) ) . to be_string
158164 expect ( parse ( :foo , :boolean ) ) . to be_boolean
You can’t perform that action at this time.
0 commit comments