Skip to content

Commit c2deda1

Browse files
committed
Sort array values for comparison in test
1 parent 7f62151 commit c2deda1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

spec/mongo/collection/view/readable_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
end
323323

324324
it 'returns the distinct values' do
325-
expect(distinct).to eq([ 'test1', 'test2', 'test3' ])
325+
expect(distinct.sort).to eq([ 'test1', 'test2', 'test3' ])
326326
end
327327
end
328328

@@ -333,7 +333,7 @@
333333
end
334334

335335
it 'returns the distinct values' do
336-
expect(distinct).to eq([ 'test1', 'test2', 'test3' ])
336+
expect(distinct.sort).to eq([ 'test1', 'test2', 'test3' ])
337337
end
338338
end
339339

@@ -364,7 +364,7 @@
364364
end
365365

366366
it 'returns the distinct values' do
367-
expect(distinct).to eq([ 'test1', 'test2', 'test3' ])
367+
expect(distinct.sort).to eq([ 'test1', 'test2', 'test3' ])
368368
end
369369
end
370370

spec/mongo/collection_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@
822822
end
823823

824824
it 'returns the distinct values' do
825-
expect(authorized_collection.distinct(:field)).to eq([ 'test1', 'test2', 'test3' ])
825+
expect(authorized_collection.distinct(:field).sort).to eq([ 'test1', 'test2', 'test3' ])
826826
end
827827

828828
context 'when a selector is provided' do
@@ -835,7 +835,7 @@
835835
context 'when options are provided' do
836836

837837
it 'passes the options to the distinct command' do
838-
expect(authorized_collection.distinct(:field, {}, max_time_ms: 100)).to eq([ 'test1', 'test2', 'test3' ])
838+
expect(authorized_collection.distinct(:field, {}, max_time_ms: 100).sort).to eq([ 'test1', 'test2', 'test3' ])
839839
end
840840
end
841841
end

0 commit comments

Comments
 (0)