Sha256: ac00a4a11b1f55072ff0a1586b152dc3f5cce319a1facdd900e374c0722df443

Contents?: true

Size: 476 Bytes

Versions: 1

Compression:

Stored size: 476 Bytes

Contents

require 'test_helper'

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
djsun-mongomapper-0.4.1.2 test/functional/test_binary.rb