Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 36a9fe1

Browse files
mamepirj
authored andcommitted
Use eval to avoid SyntaxError on Ruby 1.9.3
1 parent d1893f6 commit 36a9fe1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spec/rspec/mocks/partial_double_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,12 @@ def call(name)
8181
expect(object.foobar(:key => "value")).to equal(1)
8282
end
8383

84-
it "can accept an inner hash as a message argument" do
85-
hash = {:a => {:key => "value"}}
86-
expect(object).to receive(:foobar).with(:key => "value").and_return(1)
87-
expect(object.foobar(**hash[:a])).to equal(1)
84+
if RSpec::Support::RubyFeatures.required_kw_args_supported?
85+
it "can accept an inner hash as a message argument" do
86+
hash = {:a => {:key => "value"}}
87+
expect(object).to receive(:foobar).with(:key => "value").and_return(1)
88+
expect(object.foobar(**hash[:a])).to equal(1)
89+
end
8890
end
8991

9092
it "can create a positive message expectation" do

0 commit comments

Comments
 (0)