From fb120c7cdbc1b726d9a72fad17fed023c1f4110f Mon Sep 17 00:00:00 2001 From: Myron Marston Date: Tue, 25 Mar 2014 11:36:52 -0700 Subject: [PATCH] Update to recommended rspec 3 settings. There is still some work to be done for a few things. --- .rspec | 3 +-- spec/spec_helper.rb | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.rspec b/.rspec index 3622215..83e16f8 100644 --- a/.rspec +++ b/.rspec @@ -1,3 +1,2 @@ --color ---format documentation ---order random +--require spec_helper diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cb4d4cb..e998827 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,4 @@ require_relative '../config/setup_load_paths' -if RUBY_ENGINE == 'ruby' && !ENV['TRAVIS'] - require 'debugger' -end RSpec::Matchers.define :have_enqueued_waiting_jobs_for do |*klasses| match do |_| @@ -46,20 +43,30 @@ def step_class(name, &block) end RSpec.configure do |config| - config.treat_symbols_as_metadata_keys_with_true_values = true + # config.expose_dsl_globally = false + config.filter_run :focus config.run_all_when_everything_filtered = true - config.filter_run :f - config.alias_example_to :fit, :f - config.include PlinesSpecHelpers - config.extend PlinesSpecHelpers::ClassMethods + + if config.files_to_run.one? + config.full_backtrace = true + config.formatter = 'doc' if config.formatters.none? + end + + config.profile_examples = 10 + config.order = :random + Kernel.srand config.seed config.expect_with :rspec do |expectations| expectations.syntax = :expect end - config.mock_with :rspec do |c| - c.yield_receiver_to_any_instance_implementation_blocks = true + config.mock_with :rspec do |mocks| + mocks.syntax = :expect + # mocks.verify_partial_doubles = true end + + config.include PlinesSpecHelpers + config.extend PlinesSpecHelpers::ClassMethods end redis_url = if File.exist?('./config/redis_connection_url.txt')