Class: Mspec::Matchers::Output
- Inherits:
-
Object
- Object
- Mspec::Matchers::Output
- Defined in:
- lib/m-spec/core/matchers/output.rb
Instance Attribute Summary collapse
-
#test_code_output_string ⇒ Object
readonly
Returns the value of attribute test_code_output_string.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #check(block) ⇒ Object
-
#initialize(value) ⇒ Output
constructor
A new instance of Output.
Constructor Details
#initialize(value) ⇒ Output
Returns a new instance of Output.
8 9 10 |
# File 'lib/m-spec/core/matchers/output.rb', line 8 def initialize(value) @value = value end |
Instance Attribute Details
#test_code_output_string ⇒ Object (readonly)
Returns the value of attribute test_code_output_string.
6 7 8 |
# File 'lib/m-spec/core/matchers/output.rb', line 6 def test_code_output_string @test_code_output_string end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/m-spec/core/matchers/output.rb', line 6 def value @value end |
Instance Method Details
#check(block) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/m-spec/core/matchers/output.rb', line 12 def check(block) output = mock_output do block.call end @test_code_output_string = output.string @value == @test_code_output_string end |