Sha256: b16b5bce65be3e08adf4581a4decb67fca1d7ed5daa2daf16ed65f3c3e983f9e

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'rubocop'

require 'rubocop/rspec/support'

if ENV['CI']
  require 'codeclimate-test-reporter'
  CodeClimate::TestReporter.start
end

module SpecHelper
  ROOT = Pathname.new(__dir__).parent.freeze
end

spec_helper_glob = File.expand_path('{support,shared}/*.rb', __dir__)
Dir.glob(spec_helper_glob).map(&method(:require))

RSpec.configure do |config|
  config.order = :random

  # Define spec metadata for all rspec cop spec files
  cop_specs = 'spec/rubocop/cop/rspec/'
  config.define_derived_metadata(file_path: /\b#{cop_specs}/) do |metadata|
    # Attach metadata that signals the specified code is for an RSpec only cop
    metadata[:rspec_cop] = true
  end

  config.expect_with :rspec do |expectations|
    expectations.syntax = :expect # Disable `should`
  end

  config.mock_with :rspec do |mocks|
    mocks.syntax = :expect # Disable `should_receive` and `stub`
  end

  config.include(ExpectViolation)
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'rubocop-rspec'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rubocop-rspec-1.8.0 spec/spec_helper.rb
rubocop-rspec-1.7.0 spec/spec_helper.rb