Sha256: e430867657d52f340cbf607693dfc306e547570f1e1f04f17de4e807a988d7ff

Contents?: true

Size: 588 Bytes

Versions: 6

Compression:

Stored size: 588 Bytes

Contents

require 'test/unit'
require 'marc'

class WriterTest < Test::Unit::TestCase

    def test_writer()
        writer = MARC::Writer.new('test/writer.dat')
        record = MARC::Record.new()
        record.append(MARC::Field.new('245', '0', '1', ['a','foo']))
        writer.write(record)
        writer.close()

        # read it back to make sure
        reader = MARC::Reader.new('test/writer.dat')
        records = reader.entries()
        assert_equal(records.length(), 1)
        assert_equal(records[0], record)

        # cleanup
        File.unlink('test/writer.dat')
    end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
marc-0.0.6 test/tc_writer.rb
marc-0.0.5 test/tc_writer.rb
marc-0.0.2 test/tc_writer.rb
marc-0.0.3 test/tc_writer.rb
marc-0.0.4 test/tc_writer.rb
marc-0.0.7 test/tc_writer.rb