Class: ODDB::OdbaExporter::TestAccompLine

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
FlexMock::TestCase
Defined in:
ext/export/test/test_oddbdat.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) test_structure



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'ext/export/test/test_oddbdat.rb', line 113

def test_structure
  package = ODDB::Package.new('12')
  flexstub(package).should_receive(:oid).and_return(123)
  registration = flexmock('registration') do |mock|
    mock.should_receive(:company).and_return(flexmock('compay') do |comp|
      comp.should_receive(:oid).and_return(111)
    end)
  end
  package.sequence = flexmock('sequence') do |seq|
    seq.should_receive(:registration).and_return registration
    seq.should_receive(:iksnr).and_return('12345')
  end
  flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
  @accompline = AccompLine.new(package)
  expected = {
    1=>"19", 
    2=>"20110203000000", 
    3=>123, 
    4=>111,
    5=>"H", 
    6=>"4", 
  }
  assert_equal(expected.sort, @accompline.structure.sort)
end