Skip to content

Commit dc31673

Browse files
herwinweregon
authored andcommitted
Update specs for it parameter in proc for Ruby 4.0
The behaviour has changed in Ruby 4.0. As a bonus: fix a typo: paramater => parameter
1 parent 422b902 commit dc31673

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

core/proc/parameters_spec.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,17 @@
159159
proc { |**nil| }.parameters.should == [[:nokey]]
160160
end
161161

162-
ruby_version_is "3.4" do
163-
it "handles the usage of `it` as a paramater" do
162+
ruby_version_is "3.4"..."4.0" do
163+
it "handles the usage of `it` as a parameter" do
164164
eval("proc { it }").parameters.should == [[:opt, nil]]
165165
eval("lambda { it }").parameters.should == [[:req]]
166166
end
167167
end
168+
169+
ruby_version_is "4.0" do
170+
it "handles the usage of `it` as a parameter" do
171+
eval("proc { it }").parameters.should == [[:opt]]
172+
eval("lambda { it }").parameters.should == [[:req]]
173+
end
174+
end
168175
end

0 commit comments

Comments
 (0)