Class: Simmer::Specification::Assert::Assertions::Output
- Inherits:
-
Object
- Object
- Simmer::Specification::Assert::Assertions::Output
- Defined in:
- lib/simmer/specification/assert/assertions/output.rb
Overview
Describes an expected state of the output (log).
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #assert(_database, output) ⇒ Object
-
#initialize(value:) ⇒ Output
constructor
A new instance of Output.
Constructor Details
#initialize(value:) ⇒ Output
Returns a new instance of Output.
22 23 24 25 26 |
# File 'lib/simmer/specification/assert/assertions/output.rb', line 22 def initialize(value:) @value = value.to_s freeze end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20 21 22 |
# File 'lib/simmer/specification/assert/assertions/output.rb', line 20 def value @value end |
Instance Method Details
#assert(_database, output) ⇒ Object
28 29 30 31 32 |
# File 'lib/simmer/specification/assert/assertions/output.rb', line 28 def assert(_database, output) return nil if output.to_s.include?(value) BadOutputAssertion.new(value) end |