Module: RSpec::Expectations::ExpectationTarget::InstanceMethods
- Included in:
- RSpec::Expectations::ExpectationTarget
- Defined in:
- lib/rspec/expectations/expectation_target.rb
Overview
Defines instance RSpec::Expectations::ExpectationTarget instance methods. These are defined
in a module so we can include it in Minitest::Expectation
when
rspec/expectations/minitest_integration
is loaded in order to
support usage with Minitest.
Instance Method Summary (collapse)
-
- (Boolean) not_to(matcher = nil, message = nil, &block)
(also: #to_not)
Runs the given expectation, passing if
matcher
returns false. -
- (Boolean) to(matcher = nil, message = nil, &block)
Runs the given expectation, passing if
matcher
returns true.
Instance Method Details
- (Boolean) not_to(matcher = nil, message = nil, &block) Also known as: to_not
Runs the given expectation, passing if matcher
returns false.
76 77 78 79 |
# File 'lib/rspec/expectations/expectation_target.rb', line 76 def not_to(matcher=nil, =nil, &block) prevent_operator_matchers(:not_to) unless matcher RSpec::Expectations::NegativeExpectationHandler.handle_matcher(target, matcher, , &block) end |
- (Boolean) to(matcher = nil, message = nil, &block)
Runs the given expectation, passing if matcher
returns true.
63 64 65 66 |
# File 'lib/rspec/expectations/expectation_target.rb', line 63 def to(matcher=nil, =nil, &block) prevent_operator_matchers(:to) unless matcher RSpec::Expectations::PositiveExpectationHandler.handle_matcher(target, matcher, , &block) end |