spec/mongo/collection/view/readable_spec.rb in mongo-2.1.0.beta vs spec/mongo/collection/view/readable_spec.rb in mongo-2.1.0.rc0
- old
+ new
@@ -463,56 +463,43 @@
it 'sets the value in the options' do
expect(new_view.max_scan).to eq(10)
end
end
- describe '#no_cursor_timeout' do
+ describe '#max_value' do
let(:new_view) do
- view.no_cursor_timeout
+ view.max_value(_id: 1)
end
- it 'sets the flag' do
- expect(new_view.send(:flags)).to include(:no_cursor_timeout)
+ it 'sets the value in the options' do
+ expect(new_view.max_value).to eq('_id' => 1)
end
-
- it 'returns a new View' do
- expect(new_view).not_to be(view)
- end
end
- describe '#parallel_scan', unless: sharded? do
+ describe '#min_value' do
- let(:documents) do
- (1..200).map do |i|
- { name: "testing-scan-#{i}" }
- end
+ let(:new_view) do
+ view.min_value(_id: 1)
end
- before do
- authorized_collection.insert_many(documents)
+ it 'sets the value in the options' do
+ expect(new_view.min_value).to eq('_id' => 1)
end
+ end
- let(:cursors) do
- view.parallel_scan(2)
- end
+ describe '#no_cursor_timeout' do
- it 'returns an array of cursors', if: write_command_enabled? do
- cursors.each do |cursor|
- expect(cursor.class).to be(Mongo::Cursor)
- end
+ let(:new_view) do
+ view.no_cursor_timeout
end
- it 'returns the correct number of documents', if: write_command_enabled? do
- expect(
- cursors.reduce(0) { |total, cursor| total + cursor.to_a.size }
- ).to eq(200)
+ it 'sets the flag' do
+ expect(new_view.send(:flags)).to include(:no_cursor_timeout)
end
- it 'raises an error', unless: write_command_enabled? do
- expect {
- cursors
- }.to raise_error(Mongo::Error::OperationFailure)
+ it 'returns a new View' do
+ expect(new_view).not_to be(view)
end
end
describe '#projection' do