Class: ODDB::OdbaExporter::TestEanLine

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) setup



434
435
436
437
438
439
440
441
442
443
# File 'ext/export/test/test_oddbdat.rb', line 434

def setup
  packclass = flexmock('package') do |pack|
    pack.should_receive(:new).and_return(flexmock do |mock|
      mock.should_receive(:oid).and_return('oid')
      mock.should_receive(:barcode).and_return('barcode')
    end)
  end
  @package = packclass.new
  flexstub(Date).should_receive(:"today.strftime").and_return('20110203000000')
end

- (Object) test_barcode



444
445
446
447
# File 'ext/export/test/test_oddbdat.rb', line 444

def test_barcode
  @eanline = EanLine.new(@package)
  assert_equal('barcode', @eanline.barcode)
end

- (Object) test_structure



448
449
450
451
452
453
454
455
456
457
458
459
# File 'ext/export/test/test_oddbdat.rb', line 448

def test_structure
  @eanline = EanLine.new(@package)
  expected = {
    1=>"06", 
    2=>"20110203000000", 
    3=>"oid", 
    4=>"E13",
    5=>"barcode", 
    6=>"4", 
  }
  assert_equal(expected, @eanline.structure)
end