Sha256: 24cb71e187926e073cd543009d86f30b13ed796cec438c708d92fe5cbd3a34ed
Contents?: true
Size: 717 Bytes
Versions: 11
Compression:
Stored size: 717 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}\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
11 entries across 11 versions & 1 rubygems