Class: ODDB::State::Companies::TestMergeCompaniesState::StubApp

Inherits:
Object
  • Object
show all
Defined in:
test/test_state/companies/mergecompanies.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (StubApp) initialize

A new instance of StubApp



38
39
40
41
# File 'test/test_state/companies/mergecompanies.rb', line 38

def initialize
  @merge_called = false
  @companies ||= {}
end

Instance Attribute Details

- (Object) companies

Returns the value of attribute companies



36
37
38
# File 'test/test_state/companies/mergecompanies.rb', line 36

def companies
  @companies
end

- (Object) merge_called (readonly)

Returns the value of attribute merge_called



37
38
39
# File 'test/test_state/companies/mergecompanies.rb', line 37

def merge_called
  @merge_called
end

Instance Method Details

- (Object) company_by_name(name)



42
43
44
45
46
47
48
49
# File 'test/test_state/companies/mergecompanies.rb', line 42

def company_by_name(name)
  @companies.each_value { |company|
    if company.name == name
      return company
    end
  }    
  nil
end

- (Object) merge_companies(source, target)



50
51
52
# File 'test/test_state/companies/mergecompanies.rb', line 50

def merge_companies(source, target)
  @merge_called = true
end