Class: ODDB::OdbaExporter::TestLimitationTable

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_lines



653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'ext/export/test/test_oddbdat.rb', line 653

def test_lines
  # test package.sl_entry nil case
  package = ODDB::Package.new('12')
  @limitationtable = LimitationTable.new
  assert_equal([], @limitationtable.lines(package))

  # test not nil case
  package.create_sl_entry
  package.sl_entry.create_limitation_text
  paragraphs = ['par']
  chap = flexmock('chap') do |cha|
    cha.should_receive(:paragraphs).and_return(paragraphs)
  end
  package.sl_entry.limitation_text.descriptions[0] = chap
  flexstub(package).should_receive(:oid).and_return(123)

  # test
  flexstub(LimitationLine).should_receive(:new).with(123000).and_return('limitationline')
  assert_equal(['limitationline'], @limitationtable.lines(package))
end