Sha256: 7b2c63806eedd43e3954b88f085d34a0dbaa6d7d7bb4c228b3cfa327dd57bce6

Contents?: true

Size: 1.59 KB

Versions: 3

Compression:

Stored size: 1.59 KB

Contents

require 'rspec/autorun'

if ENV['COVERAGE']
  require 'simplecov'
  formatters = [SimpleCov::Formatter::HTMLFormatter]
  begin
    puts '[COVERAGE] Running with SimpleCov HTML Formatter'
    require 'simplecov-rcov-text'
    formatters << SimpleCov::Formatter::RcovTextFormatter
    puts '[COVERAGE] Running with SimpleCov Rcov Formatter'
  rescue LoadError
    puts '[COVERAGE] SimpleCov Rcov formatter could not be loaded'
  end
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ *formatters ]
  SimpleCov.start
end

require 'date'
require 'construct'
require 'json'
require 'pry-nav'

# add lib to the load path just like rubygems does
$:.unshift File.expand_path("../../lib", __FILE__)
require 'metric_fu'
include MetricFu
def mf_log(msg); mf_debug(msg); end

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[MetricFu.root_dir + "/spec/support/**/*.rb"].each {|f| require f}

RSpec.configure do |config|
  config.mock_with :rspec

  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.filter_run focus: true
  config.run_all_when_everything_filtered = true
  config.filter_run_excluding :slow unless ENV["SLOW_SPECS"]
  config.fail_fast = ENV.include?('FAIL_FAST')
  config.order = 'random'

  # :suite after/before all specs
  # :each every describe block
  # :all every it block

  def run_dir
    File.expand_path('dummy', File.dirname(__FILE__))
  end

  config.before(:suite) do
    MetricFu.run_dir = run_dir
  end

  config.after(:suite) do
    cleanup_fs
  end

  config.after(:each) do
    MetricFu.reset
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metric_fu-4.6.0 spec/spec_helper.rb
metric_fu-4.5.2 spec/spec_helper.rb
metric_fu-4.5.1 spec/spec_helper.rb