Sha256: 9a3cae19e23a0fa0c25647d1e2f80d7f9c9a21430f9aa2b7c138d8c34516a9d1

Contents?: true

Size: 899 Bytes

Versions: 9

Compression:

Stored size: 899 Bytes

Contents

require 'test_helper'
class XmlUtilTest < Test::Unit::TestCase
  def test_to_xml
    assert_nothing_raised {
      record = Exlibris::Primo::Record.new(:raw_xml => "<record><control><recordid>123456</recordid></control></record>\n")
      assert_equal "<record><control><recordid>123456</recordid></control></record>", record.to_xml
    }
  end

  def test_to_hash
    assert_nothing_raised {
      record = Exlibris::Primo::Record.new(:raw_xml => "<record><control><recordid>123456</recordid></control></record>\n")
      assert_equal({"record"=> { "control" => { "recordid"=> "123456" } } }, record.to_hash)
    }
  end

  def test_to_json
    assert_nothing_raised {
      record = Exlibris::Primo::Record.new(:raw_xml => "<record><control><recordid>123456</recordid></control></record>\n")
      assert_equal "{\"record\":{\"control\":{\"recordid\":\"123456\"}}}", record.to_json
    }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
exlibris-primo-1.0.8 test/xml_util_test.rb
exlibris-primo-1.0.7 test/xml_util_test.rb
exlibris-primo-1.0.6 test/xml_util_test.rb
exlibris-primo-1.0.5 test/xml_util_test.rb
exlibris-primo-1.0.4 test/xml_util_test.rb
exlibris-primo-1.0.3 test/xml_util_test.rb
exlibris-primo-1.0.2 test/xml_util_test.rb
exlibris-primo-1.0.1 test/xml_util_test.rb
exlibris-primo-1.0.0 test/xml_util_test.rb