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

Commit

Permalink
dont globally shim ruby2_keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmohare committed Feb 27, 2024
1 parent 869067e commit fd1dbb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/rspec/support/method_signature_verifier_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require 'rspec/support'
require 'rspec/support/method_signature_verifier'

def ruby2_keywords(*); end unless respond_to?(:ruby2_keywords, true)

module RSpec
module Support
RSpec.describe 'verifying methods' do
Expand All @@ -12,17 +10,19 @@ def valid_non_kw_args?(arity)
described_class.new(signature, [nil] * arity).valid?
end

ruby2_keywords def valid?(*args)
def valid?(*args)
described_class.new(signature, args).valid?
end
ruby2_keywords(:valid?) if respond_to?(:ruby2_keywords, true)

def error_description
described_class.new(signature).error_message[/Expected (.*),/, 1]
end

ruby2_keywords def error_for(*args)
def error_for(*args)
described_class.new(signature, args).error_message
end
ruby2_keywords(:error_for) if respond_to?(:ruby2_keywords, true)

def signature_description
signature.description
Expand Down

0 comments on commit fd1dbb6

Please sign in to comment.