Class: TarkaMatchers::Helpers::Expectation::ExpectCapture
- Defined in:
- lib/tarka_matchers/helpers/expectation/expect_capture.rb
Class Attribute Summary collapse
-
.actual_matcher ⇒ Object
writeonly
Sets the attribute actual_matcher.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target, block_target) ⇒ ExpectCapture
constructor
A new instance of ExpectCapture.
- #to(matcher) ⇒ Object
- #to_not(matcher) ⇒ Object
Constructor Details
#initialize(target, block_target) ⇒ ExpectCapture
Returns a new instance of ExpectCapture.
5 6 7 |
# File 'lib/tarka_matchers/helpers/expectation/expect_capture.rb', line 5 def initialize target, block_target target == :undefined ? @target = block_target.call : @target = target end |
Class Attribute Details
.actual_matcher=(value) ⇒ Object (writeonly)
Sets the attribute actual_matcher
17 18 19 |
# File 'lib/tarka_matchers/helpers/expectation/expect_capture.rb', line 17 def actual_matcher=(value) @actual_matcher = value end |
Class Method Details
.capture(actual) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/tarka_matchers/helpers/expectation/expect_capture.rb', line 9 def self.capture actual self.redefine actual.call self.replace @actual_matcher end |
Instance Method Details
#to(matcher) ⇒ Object
20 21 22 |
# File 'lib/tarka_matchers/helpers/expectation/expect_capture.rb', line 20 def to matcher match_populate 'should ', matcher end |
#to_not(matcher) ⇒ Object
24 25 26 |
# File 'lib/tarka_matchers/helpers/expectation/expect_capture.rb', line 24 def to_not matcher match_populate 'should not ', matcher end |