Skip to content

Commit

Permalink
Wrap keyword args definitions in eval blocks for 1.8.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Apr 5, 2020
1 parent f6528ff commit 0f7d1d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/rspec/matchers/dsl_spec.rb
Expand Up @@ -30,6 +30,7 @@ def ok
end

if RSpec::Support::RubyFeatures.kw_args_supported?
binding.eval(<<-CODE, __FILE__, __LINE__)
def kw(a:)
a
end
Expand All @@ -38,6 +39,7 @@ def kw(a:)
RSpec::Matchers.define(:matcher_kw) {}
expect(matcher_kw.kw(a: 1)).to eq(1)
end
CODE
end

it "clears user instance variables between invocations" do
Expand Down

0 comments on commit 0f7d1d9

Please sign in to comment.