Sha256: 004486f612f0ed1994c97c4cab8a433cbe706a4c091116fbc70af63bc0e615d8

Contents?: true

Size: 576 Bytes

Versions: 10

Compression:

Stored size: 576 Bytes

Contents

# encoding:utf-8
require './test/bson/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

10 entries across 10 versions & 2 rubygems

Version Path
bson-1.5.1-jruby test/bson/bson_string_test.rb
bson-1.5.1 test/bson/bson_string_test.rb
mongo-1.5.1 test/bson/bson_string_test.rb
bson-1.5.0.rc0-jruby test/bson/bson_string_test.rb
bson-1.5.0.rc0 test/bson/bson_string_test.rb
mongo-1.5.0.rc0 test/bson/bson_string_test.rb
bson-1.4.1-jruby test/bson/bson_string_test.rb
bson-1.4.0-jruby test/bson/bson_string_test.rb
bson-1.4.0 test/bson/bson_string_test.rb
mongo-1.4.0 test/bson/bson_string_test.rb