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

Commit dea9067

Browse files
mamepirj
authored andcommitted
Wrap the whole spec in an eval
to avoid a warning: "assigned but unused variable - hash"
1 parent 36a9fe1 commit dea9067

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spec/rspec/mocks/partial_double_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,14 @@ def call(name)
8282
end
8383

8484
if RSpec::Support::RubyFeatures.required_kw_args_supported?
85+
# Use eval to avoid syntax error on 1.8 and 1.9
86+
binding.eval(<<-CODE, __FILE__, __LINE__)
8587
it "can accept an inner hash as a message argument" do
8688
hash = {:a => {:key => "value"}}
8789
expect(object).to receive(:foobar).with(:key => "value").and_return(1)
8890
expect(object.foobar(**hash[:a])).to equal(1)
8991
end
92+
CODE
9093
end
9194

9295
it "can create a positive message expectation" do

0 commit comments

Comments
 (0)