lib/spectus/expectation_target.rb in spectus-1.0.1 vs lib/spectus/expectation_target.rb in spectus-1.1.1
- old
+ new
@@ -4,31 +4,29 @@
# Wraps the target of an expectation.
#
# @example
# expect { do_something } # => ExpectationTarget wrapping the block
- class ExpectationTarget
+ class ExpectationTarget < BasicObject
def initialize &actual
@actual = actual
-
- freeze
end
# Evaluate to a positive assertion.
#
# @api public
#
- # @see Matcher#eval
+ # @see Matcher#pass?
def to definition
- Matcher.eval false, definition, &@actual
+ Matcher.pass? false, definition, &@actual
end
# Evaluate to a negative assertion.
#
# @api public
#
- # @see Matcher#eval
+ # @see Matcher#pass?
def not_to definition
- Matcher.eval true, definition, &@actual
+ Matcher.pass? true, definition, &@actual
end
end
end