spec/mongo/protocol/query_spec.rb in mongo-2.1.2 vs spec/mongo/protocol/query_spec.rb in mongo-2.2.0.rc0

- old
+ new

@@ -145,11 +145,11 @@ let(:bytes) { message.serialize } include_examples 'message with a header' describe 'flags' do - let(:field) { bytes[16..19] } + let(:field) { bytes.to_s[16..19] } context 'when no flags are provided' do it 'does not set any bits' do expect(field).to be_int32(0) end @@ -215,17 +215,17 @@ end end end describe 'namespace' do - let(:field) { bytes[20..36] } + let(:field) { bytes.to_s[20..36] } it 'serializes the namespace' do expect(field).to be_cstring(ns) end context 'when the namespace contains unicode characters' do - let(:field) { bytes[20..40] } + let(:field) { bytes.to_s[20..40] } let(:coll) do 'områder' end @@ -235,11 +235,11 @@ end end describe 'skip' do - let(:field) { bytes[37..40] } + let(:field) { bytes.to_s[37..40] } context 'when no skip is provided' do it 'serializes a zero' do expect(field).to be_int32(0) end @@ -253,11 +253,11 @@ end end end describe 'limit' do - let(:field) { bytes[41..44] } + let(:field) { bytes.to_s[41..44] } context 'when no limit is provided' do it 'serializes a zero' do expect(field).to be_int32(0) end @@ -270,17 +270,17 @@ end end end describe 'selector' do - let(:field) { bytes[45..65] } + let(:field) { bytes.to_s[45..65] } it 'serializes the selector' do expect(field).to be_bson(selector) end end describe 'project' do - let(:field) { bytes[66..-1] } + let(:field) { bytes.to_s[66..-1] } context 'when no projection is provided' do it 'does not serialize a projection' do expect(field).to be_empty end end