Class: Simmer::Database::Fixture

Inherits:
Object
  • Object
show all
Defined in:
lib/simmer/database/fixture.rb

Overview

A fixture is a database record that can be inserted in the Stage phase of a specification execution.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields: {}, name:, table:) ⇒ Fixture

Returns a new instance of Fixture.



21
22
23
24
25
# File 'lib/simmer/database/fixture.rb', line 21

def initialize(fields: {}, name:, table:)
  @fields = fields || {}
  @name   = name.to_s
  @table  = table.to_s
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



17
18
19
# File 'lib/simmer/database/fixture.rb', line 17

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name.



17
18
19
# File 'lib/simmer/database/fixture.rb', line 17

def name
  @name
end

#tableObject (readonly)

Returns the value of attribute table.



17
18
19
# File 'lib/simmer/database/fixture.rb', line 17

def table
  @table
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



27
28
29
30
31
32
# File 'lib/simmer/database/fixture.rb', line 27

def ==(other)
  other.instance_of?(self.class) &&
    fields == other.fields &&
    name == other.name &&
    table == other.table
end