Class: Simmer::Specification::Assert::Assertions::BadTableAssertion

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

Overview

Describes when a database table does not meet expectations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, expected_record_set, actual_record_set) ⇒ BadTableAssertion

Returns a new instance of BadTableAssertion.



18
19
20
21
22
23
24
# File 'lib/simmer/specification/assert/assertions/bad_table_assertion.rb', line 18

def initialize(name, expected_record_set, actual_record_set)
  @name                = name
  @expected_record_set = expected_record_set
  @actual_record_set   = actual_record_set

  freeze
end

Instance Attribute Details

#actual_record_setObject (readonly)

Returns the value of attribute actual_record_set.



16
17
18
# File 'lib/simmer/specification/assert/assertions/bad_table_assertion.rb', line 16

def actual_record_set
  @actual_record_set
end

#expected_record_setObject (readonly)

Returns the value of attribute expected_record_set.



16
17
18
# File 'lib/simmer/specification/assert/assertions/bad_table_assertion.rb', line 16

def expected_record_set
  @expected_record_set
end

#nameObject (readonly)

Returns the value of attribute name.



16
17
18
# File 'lib/simmer/specification/assert/assertions/bad_table_assertion.rb', line 16

def name
  @name
end

Instance Method Details

#to_hObject



26
27
28
29
30
31
32
33
# File 'lib/simmer/specification/assert/assertions/bad_table_assertion.rb', line 26

def to_h
  {
    'type' => 'table',
    'name' => name,
    'expected_record_set' => expected_record_set.to_h,
    'actual_record_set' => actual_record_set.to_h
  }
end