spec/thinking_sphinx/errors_spec.rb in thinking-sphinx-3.1.4 vs spec/thinking_sphinx/errors_spec.rb in thinking-sphinx-3.2.0
- old
+ new
@@ -31,9 +31,16 @@
ThinkingSphinx::SphinxError.new_from_mysql(error).
should be_a(ThinkingSphinx::ConnectionError)
end
+ it 'translates out-of-bounds errors' do
+ error.stub :message => "offset out of bounds (offset=1001, max_matches=1000)"
+
+ ThinkingSphinx::SphinxError.new_from_mysql(error).
+ should be_a(ThinkingSphinx::OutOfBoundsError)
+ end
+
it 'prefixes the connection error message' do
error.stub :message => "Can't connect to MySQL server on '127.0.0.1' (61)"
ThinkingSphinx::SphinxError.new_from_mysql(error).message.
should == "Error connecting to Sphinx via the MySQL protocol. Can't connect to MySQL server on '127.0.0.1' (61)"