Skip to content
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.

Commit

Permalink
Aborting integration tests when ElasticSearch is not running
Browse files Browse the repository at this point in the history
  • Loading branch information
karmi committed Feb 7, 2011
1 parent 7bd167b commit e372dca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ module Test::Integration
URL = "http://localhost:9200"

def setup
begin
::RestClient.get URL
rescue Errno::ECONNREFUSED
abort "\n\n#{'-'*87}\n[ABORTED] You have to run ElasticSearch on #{URL} for integration tests\n#{'-'*87}\n\n"
end

::RestClient.delete "#{URL}/articles-test" rescue nil
::RestClient.post "#{URL}/articles-test", ''
fixtures_path.join('articles').entries.each do |f|
Expand Down

0 comments on commit e372dca

Please sign in to comment.