Sha256: a56e097d5f398129eaee61fb22c47bf92c1a8932766576dd3dec33de3392d47c

Contents?: true

Size: 431 Bytes

Versions: 20

Compression:

Stored size: 431 Bytes

Contents

require 'test_helper'

class BinaryTest < Test::Unit::TestCase  
  should "serialize and deserialize correctly" do
    klass = Class.new do
      include MongoMapper::Document
      set_collection_name 'test'
      key :contents, Binary
    end
    klass.collection.remove
    
    doc = klass.new(:contents => '010101')
    doc.save
    
    doc = doc.reload
    doc.contents.to_s.should == ByteBuffer.new('010101').to_s
  end
end

Version data entries

20 entries across 20 versions & 5 rubygems

Version Path
tpitale-mongo_mapper-0.6.9 test/functional/test_binary.rb
mongo_mapper-unstable-2009.12.30 test/functional/test_binary.rb
mongo_mapper-unstable-2009.12.29 test/functional/test_binary.rb
mongo_mapper-unstable-2009.12.23 test/functional/test_binary.rb
mongo_mapper-unstable-2009.12.22 test/functional/test_binary.rb
mongo_mapper-unstable-2009.12.16 test/functional/test_binary.rb
mongo_mapper-0.6.8 test/functional/test_binary.rb
mongo_mapper-unstable-2009.12.14 test/functional/test_binary.rb
mongo_mapper-0.6.7 test/functional/test_binary.rb
mongo_mapper-0.6.6 test/functional/test_binary.rb
mongo_mapper-unstable-2009.12.4 test/functional/test_binary.rb
danielharan-mongo_mapper-0.6.5 test/functional/test_binary.rb
mongo_mapper-0.6.5 test/functional/test_binary.rb
webbynode-mongo_mapper-0.6.4 test/functional/test_binary.rb
mongo_mapper-0.6.4 test/functional/test_binary.rb
mongo_mapper-0.6.3 test/functional/test_binary.rb
mongo_mapper-0.6.2 test/functional/test_binary.rb
mongo_mapper-0.6.1 test/functional/test_binary.rb
mongo_mapper-unstable-2009.11.18 test/functional/test_binary.rb
mongo_mapper-0.6.0 test/functional/test_binary.rb