Class: ODDB::OdbaExporter::TestAcLimTable

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



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'ext/export/test/test_oddbdat.rb', line 576

def test_lines
  # test package.sl_entry == nil calse
  package = ODDB::Package.new('12')
  @aclimtable = AcLimTable.new
  assert_equal([], @aclimtable.lines(package))

  # test not nil case
  ## preparation
  package.create_sl_entry
  package.sl_entry.create_limitation_text
  paragraphs = [1,2]
  chap = flexmock('chap') do |chap|
    chap.should_receive(:paragraphs).and_return(flexmock('paragraphs') do |para|
      para.should_receive(:each_with_index).and_yield(paragraphs)
    end)
  end
  package.sl_entry.limitation_text.descriptions[0] = chap
  ## test 
  flexstub(AcLimLine).should_receive(:new).with(1,2,1002).and_return('aclimline')
  assert_equal(['aclimline'], @aclimtable.lines(package))
end