Class: Simmer::Specification::Assert::Assertions::Output

Inherits:
Object
  • Object
show all
Defined in:
lib/simmer/specification/assert/assertions/output.rb

Overview

Describes an expected state of the output (log).

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject (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