test/searcher_test.rb in inquisitio-0.1.1 vs test/searcher_test.rb in inquisitio-0.1.2
- old
+ new
@@ -215,9 +215,19 @@
assert_raises(InquisitioError, "Search failed with status code 500") do
searcher.search
end
end
+ def test_search_raises_exception_when_excon_exception_thrown
+ Excon.stub({}, lambda { |_| raise Excon::Errors::Timeout})
+
+ searcher = Searcher.where('Star Wars')
+
+ assert_raises(InquisitioError) do
+ searcher.search
+ end
+ end
+
def test_that_iterating_calls_results
searcher = Searcher.where("star_wars")
searcher.expects(results: [])
searcher.each { }
end