Skip to content

Commit 7c69a53

Browse files
committed
Also allow more precision if the implementation is able to give it
* TruffleRuby returns [[:opt]] which seems correct too here.
1 parent 650961b commit 7c69a53

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/ruby/core/method/parameters_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,12 @@ def one_splat_one_block(*args, &block)
247247
"foo".method(:delete!).parameters.should == [[:rest]]
248248
end
249249

250-
it "returns [[:rest]] for core methods with optional arguments" do
250+
it "returns [[:rest]] or [[:opt]] for core methods with optional arguments" do
251251
# pop takes 1 optional argument
252-
[].method(:pop).parameters.should == [[:rest]]
252+
[
253+
[[:rest]],
254+
[[:opt]]
255+
].should include([].method(:pop).parameters)
253256
end
254257

255258
it "returns [[:req]] for each parameter for core methods with fixed-length argument lists" do

0 commit comments

Comments
 (0)