You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/mongo/client_construction_spec.rb
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1773,28 +1773,28 @@
1773
1773
expectdo
1774
1774
client=new_local_client_nmio(['127.0.0.1:27017'],
1775
1775
:read=>{:mode=>:bogus})
1776
-
end.toraise_error(Mongo::Error::InvalidReadOption,'Invalid read option: {"mode"=>:bogus}: mode bogus is not one of recognized modes')
1776
+
end.toraise_error(Mongo::Error::InvalidReadOption,'Invalid read preference value: {"mode"=>:bogus}: mode bogus is not one of recognized modes')
1777
1777
end
1778
1778
1779
1779
it'rejects bogus read preference as string'do
1780
1780
expectdo
1781
1781
client=new_local_client_nmio(['127.0.0.1:27017'],
1782
1782
:read=>{:mode=>'bogus'})
1783
-
end.toraise_error(Mongo::Error::InvalidReadOption,'Invalid read option: {"mode"=>"bogus"}: mode bogus is not one of recognized modes')
1783
+
end.toraise_error(Mongo::Error::InvalidReadOption,'Invalid read preference value: {"mode"=>"bogus"}: mode bogus is not one of recognized modes')
1784
1784
end
1785
1785
1786
1786
it'rejects read option specified as a string'do
1787
1787
expectdo
1788
1788
client=new_local_client_nmio(['127.0.0.1:27017'],
1789
1789
:read=>'primary')
1790
-
end.toraise_error(Mongo::Error::InvalidReadOption,'Invalid read option: primary: must be a hash')
1790
+
end.toraise_error(Mongo::Error::InvalidReadOption,'Invalid read preference value: "primary": the read preference must be specified as a hash: { mode: "primary" }')
1791
1791
end
1792
1792
1793
1793
it'rejects read option specified as a symbol'do
1794
1794
expectdo
1795
1795
client=new_local_client_nmio(['127.0.0.1:27017'],
1796
1796
:read=>:primary)
1797
-
end.toraise_error(Mongo::Error::InvalidReadOption,'Invalid read option: primary: must be a hash')
1797
+
end.toraise_error(Mongo::Error::InvalidReadOption,"Invalid read preference value: :primary: the read preference must be specified as a hash: { mode: :primary }")
0 commit comments