spec/spec_helper.rb in stealth-1.1.6 vs spec/spec_helper.rb in stealth-2.0.0.beta1
- old
+ new
@@ -4,16 +4,37 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'stealth'
+require 'sidekiq/testing'
require 'mock_redis'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
$redis = MockRedis.new
+$services_yml = File.read(File.join(File.dirname(__FILE__), 'support', 'services.yml'))
RSpec.configure do |config|
ENV['STEALTH_ENV'] = 'test'
+
+ config.before(:each) do |example|
+ Sidekiq::Testing.fake!
+
+ Stealth.load_services_config!($services_yml)
+ end
+
+ config.expect_with :rspec do |expectations|
+ # This option will default to `true` in RSpec 4. It makes the `description`
+ # and `failure_message` of custom matchers include text for helper methods
+ # defined using `chain`, e.g.:
+ # be_bigger_than(2).and_smaller_than(4).description
+ # # => "be bigger than 2 and smaller than 4"
+ # ...rather than:
+ # # => "be bigger than 2"
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
+
+ expectations.on_potential_false_positives = :nothing
+ end
end