Sha256: 443fa5879d30bf59ac74d92ff6439378f84285bc62ddec49b0ccf48e891ef8d6

Contents?: true

Size: 571 Bytes

Versions: 9

Compression:

Stored size: 571 Bytes

Contents

# encoding:utf-8
require './test/test_helper'
require 'complex'
require 'bigdecimal'
require 'rational'

class BSONTest < Test::Unit::TestCase

  include BSON

  def setup
    @encoder = BSON::BSON_CODER
  end

  def assert_doc_pass(doc, options={})
    bson = @encoder.serialize(doc)
    if options[:debug]
      puts "DEBUGGING DOC:"
      p bson.to_a
      puts "DESERIALIZES TO:"
    end
    assert_equal @encoder.serialize(doc).to_a, bson.to_a
    assert_equal doc, @encoder.deserialize(bson)
  end

  def test_string
    assert_doc_pass({:a => "hello"})
  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
bson-1.3.0.rc0-jruby test/bson/bson_string_test.rb
bson-1.3.0.rc0 test/bson/bson_string_test.rb
mongo-1.3.0.rc0 test/bson/bson_string_test.rb
bson-1.2.4-jruby test/bson/bson_string_test.rb
bson-1.2.4 test/bson/bson_string_test.rb
mongo-1.2.4 test/bson/bson_string_test.rb
bson-1.2.3-jruby test/bson/bson_string_test.rb
bson-1.2.3 test/bson/bson_string_test.rb
mongo-1.2.3 test/bson/bson_string_test.rb