spec/spec_helper.rb in gummi-0.2.2 vs spec/spec_helper.rb in gummi-0.2.3

- old
+ new

@@ -31,17 +31,28 @@ require 'db/person' require 'db/rating' require 'db/ship' +def setup_elastic + Gummi::DbLayer::DefaultIndex.setup + DB::Person.sync_mapping! + DB::Rating.sync_mapping! + DB::Ship.sync_mapping! +end + RSpec.configure do |config| config.before(:suite) do - Gummi::DbLayer::DefaultIndex.setup - DB::Person.sync_mapping! - DB::Rating.sync_mapping! - DB::Ship.sync_mapping! + setup_elastic end + config.before(:each, elastic: true) do + setup_elastic + end + + config.after(:each, elastic: true) do + Gummi::DbLayer::DefaultIndex.teardown + end config.after(:suite) do Gummi::DbLayer::DefaultIndex.teardown end end