spec/spec_helper.rb in pact_broker-0.0.10 vs spec/spec_helper.rb in pact_broker-1.0.0.alpha1
- old
+ new
@@ -1,20 +1,27 @@
-require 'simplecov' # At the top because simplecov needs to watch files being loaded
ENV['RACK_ENV'] = 'test'
RACK_ENV = 'test'
$: << File.expand_path("../../", __FILE__)
require 'rack/test'
-require 'pact_broker/db'
+require 'db'
require './spec/support/provider_state_builder'
require 'pact_broker/api'
require 'rspec/fire'
+def load_fixture(file_name)
+ File.read(File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', file_name)))
+end
+
+def load_json_fixture(file_name)
+ require 'json'
+ JSON.parse(load_fixture(file_name))
+end
+
RSpec.configure do | config |
config.before :suite do
raise "Wrong environment!!! Don't run this script!! ENV['RACK_ENV'] is #{ENV['RACK_ENV']} and RACK_ENV is #{RACK_ENV}" if ENV['RACK_ENV'] != 'test' || RACK_ENV != 'test'
- # puts caller.take 20
end
config.before :each do
DB::PACT_BROKER_DB[:pacts].truncate
DB::PACT_BROKER_DB[:tags].truncate