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

Commit e7df10c

Browse files
committed
Use define_method instead of class_eval
1 parent 4f05d41 commit e7df10c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/rspec/core/configuration.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,9 @@ def self.define_alias(name, alias_name)
7575

7676
# @private
7777
def self.define_predicate(name)
78-
class_eval <<-PREDICATE, __FILE__ , __LINE__ + 1
79-
def #{name}?
80-
!!#{name}
81-
end
82-
PREDICATE
78+
define_method "#{name}?" do
79+
!!send(name)
80+
end
8381
end
8482

8583
# @private

0 commit comments

Comments
 (0)