Skip to content

Commit

Permalink
Use define_method instead of class_eval
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Jun 5, 2020
1 parent 29b5099 commit ddc46f6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/rspec/core/configuration.rb
Expand Up @@ -75,11 +75,9 @@ def self.define_alias(name, alias_name)

# @private
def self.define_predicate(name)
class_eval <<-PREDICATE, __FILE__ , __LINE__ + 1
def #{name}?
!!#{name}
end
PREDICATE
define_method "#{name}?" do
!!send(name)
end
end

# @private
Expand Down

0 comments on commit ddc46f6

Please sign in to comment.