Sha256: 5683a45179e2aeffa94c7ee2ea651bf0b78018349c57be0ed2a68a939b2f9cde
Contents?: true
Size: 746 Bytes
Versions: 3
Compression:
Stored size: 746 Bytes
Contents
RSpec::Matchers.define :be_int32 do |num| match do |actual| actual == [num].pack('l<') end end RSpec::Matchers.define :be_int64 do |num| match do |actual| actual == [num].pack('q<') end end RSpec::Matchers.define :be_int64_sequence do |array| match do |actual| actual == array.reduce(String.new) do |buffer, num| buffer << [num].pack('q<') end end end RSpec::Matchers.define :be_cstring do |string| match do |actual| actual == "#{string.force_encoding(BSON::BINARY)}\0" end end RSpec::Matchers.define :be_bson do |hash| match do |actual| actual == hash.to_bson end end RSpec::Matchers.define :be_bson_sequence do |array| match do |actual| actual == array.map(&:to_bson).join end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mongo-2.1.2 | spec/support/matchers.rb |
mongo-2.1.1 | spec/support/matchers.rb |
mongo-2.1.0 | spec/support/matchers.rb |