Sha256: ee0c08fcd4cc860a2ec596b50719e87ff222876360aee6df3f31df1251cedf59

Contents?: true

Size: 986 Bytes

Versions: 6

Compression:

Stored size: 986 Bytes

Contents

# ------------------------------------------------------------
# SimpleCov

if ENV['COVERAGE']
  require 'simplecov'

  spec_root = File.realpath(__dir__)
  spec_group_re = %r{(?<=^#{spec_root}/)[^/]+(?=/)}

  RSpec.configure do |config|
    config.before(:each) do |example|
      abs_path = File.realpath(example.metadata[:absolute_file_path])
      match_data = spec_group_re.match(abs_path)
      raise ArgumentError, "Unable to determine group for example at #{abs_path}" unless match_data

      spec_group = match_data[0]
      SimpleCov.command_name(spec_group)
      SimpleCov.coverage_dir("artifacts/simplecov/#{spec_group}")
    end
  end
end

# ------------------------------------------------------------
# RSpec

RSpec.configure do |config|
  config.color = true
  config.tty = true
  config.formatter = :documentation
  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end
  config.shared_context_metadata_behavior = :apply_to_host_groups
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
berkeley_library-logging-0.2.5 spec/spec_helper.rb
berkeley_library-logging-0.2.4 spec/spec_helper.rb
berkeley_library-logging-0.2.3 spec/spec_helper.rb
berkeley_library-logging-0.2.2 spec/spec_helper.rb
berkeley_library-logging-0.2.1 spec/spec_helper.rb
berkeley_library-logging-0.2.0 spec/spec_helper.rb