Class: RSpec::Clone::ExpectationTarget::Base Private
- Inherits:
-
Object
- Object
- RSpec::Clone::ExpectationTarget::Base
- Defined in:
- lib/r_spec/clone/expectation_target/base.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
‘RSpec::Clone::ExpectationTarget::Base` is not intended to be instantiated directly by users. Use `expect` instead.
Abstract expectation target base class.
Instance Method Summary collapse
-
#initialize(input) ⇒ Base
constructor
private
Instantiate a new expectation target.
-
#not_to(matcher) ⇒ nil
Runs the given expectation, passing if ‘matcher` returns false.
-
#to(matcher) ⇒ nil
Runs the given expectation, passing if ‘matcher` returns true.
Constructor Details
#initialize(input) ⇒ Base
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instantiate a new expectation target.
19 20 21 |
# File 'lib/r_spec/clone/expectation_target/base.rb', line 19 def initialize(input) @input = input end |
Instance Method Details
#not_to(matcher) ⇒ nil
Runs the given expectation, passing if ‘matcher` returns false.
49 50 51 |
# File 'lib/r_spec/clone/expectation_target/base.rb', line 49 def not_to(matcher) absolute_requirement(matcher:, negate: true) end |
#to(matcher) ⇒ nil
Runs the given expectation, passing if ‘matcher` returns true.
34 35 36 |
# File 'lib/r_spec/clone/expectation_target/base.rb', line 34 def to(matcher) absolute_requirement(matcher:, negate: false) end |