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!
116
116
when nil
117
117
return
118
118
when TrueClass , FalseClass
119
- :boolean
119
+ required? ? :string : :boolean
120
120
when Numeric
121
121
:numeric
122
122
when Symbol
Original file line number Diff line number Diff line change @@ -153,6 +153,12 @@ def option(name, options = {})
153
153
end . to raise_error ( ArgumentError , "An option cannot be boolean and required." )
154
154
end
155
155
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
+
156
162
it "allows type predicates" do
157
163
expect ( parse ( :foo , :string ) ) . to be_string
158
164
expect ( parse ( :foo , :boolean ) ) . to be_boolean
You can’t perform that action at this time.
0 commit comments