Class: ODDB::OdbaExporter::TestAtcLine

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



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# File 'ext/export/test/test_oddbdat.rb', line 370

def test_structure
  # test nil case
  @atcline = AtcLine.new(nil)
  assert_equal(nil, @atcline.structure)

  # test not nil case
  atcclass = flexmock('atcclass') do |atc|
    atc.should_receive(:code).and_return('code')
    atc.should_receive(:description).and_return('description')
  end
  flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
  @atcline = AtcLine.new(atcclass)
  expected = {
    1=>"11",
    2=>"20110203000000",
    3=>"8",
    4=>"code",
    5=>"D",
    6=>"4",
    7=>"description",
  }
  assert_equal(expected, @atcline.structure)
end