Skip to content

Commit

Permalink
Updated block keyword parsing to MRI 2.2.0 behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Dec 24, 2014
1 parent 02d4e83 commit 22cb693
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/ruby/language/block_spec.rb
Expand Up @@ -93,9 +93,9 @@ def m(a) yield a end

it "calls #to_hash on the element that maps to the keyword arguments" do
x = mock("destructure matching block keyword argument")
x.should_receive(:to_hash).and_return({x: 9})
x.should_not_receive(:to_hash)
y = mock("destructure non-matching block keyword argument")
y.should_not_receive(:to_hash)
y.should_receive(:to_hash).and_return({x: 9})

result = m([1, 2, 3, x, 4, 5, y]) { |a, b=5, c, **k| [a, b, c, k] }
result.should == [1, 2, 3, {x: 9}]
Expand Down

0 comments on commit 22cb693

Please sign in to comment.