File tree 3 files changed +10
-1
lines changed
lib/grape-swagger/doc_methods 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 3
3
#### Features
4
4
5
5
* Your contribution here.
6
+ * [ #613 ] ( https://github.com/ruby-grape/grape-swagger/pull/613 ) : Fix Proc with arity one in param values - [ @timothysu ] ( https://github.com/timothysu ) .
6
7
7
8
#### Fixes
8
9
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def param_type(value_type)
101
101
def parse_enum_or_range_values ( values )
102
102
case values
103
103
when Proc
104
- parse_enum_or_range_values ( values . call )
104
+ parse_enum_or_range_values ( values . call ) if values . parameters . empty?
105
105
when Range
106
106
parse_range_values ( values ) if values . first . is_a? ( Integer )
107
107
else
Original file line number Diff line number Diff line change 47
47
expect ( parsed_range ) . to eql ( enum : %w[ a b c ] )
48
48
end
49
49
end
50
+
51
+ describe 'with arity one' do
52
+ let ( :values ) { proc { |v | v < 25 } }
53
+ specify do
54
+ parsed_range = subject . send ( :parse_enum_or_range_values , values )
55
+ expect ( parsed_range ) . to be_nil
56
+ end
57
+ end
50
58
end
51
59
52
60
describe 'values as Array -> enums' do
You can’t perform that action at this time.
0 commit comments