Sha256: fab6db53c70adb645ba572bd043b6c4b59333bca54bccb31ee957420236a6342

Contents?: true

Size: 1.48 KB

Versions: 10

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true

if ENV['COVERAGE'] == 'true'
  require 'simplecov'

  SimpleCov.start do
    command_name 'spec:unit'

    add_filter 'config'
    add_filter 'spec'
    add_filter 'vendor'
    add_filter 'test_app'
    add_filter 'lib/mutant.rb' # simplecov bug not seeing default block is executed

    minimum_coverage 100
  end
end

require 'tempfile'
require 'concord'
require 'anima'
require 'adamantium'
require 'devtools/spec_helper'
require 'unparser/cli'
require 'mutant'
require 'mutant/meta'

$LOAD_PATH << File.join(TestApp.root, 'lib')

require 'test_app'

module Fixtures
  TEST_CONFIG = Mutant::Config::DEFAULT
    .with(reporter: Mutant::Reporter::Null.new)

  TEST_ENV = Mutant::Bootstrap
    .apply(Mutant::WORLD, TEST_CONFIG).from_right

end # Fixtures

module ParserHelper
  def generate(node)
    Unparser.unparse(node)
  end

  def parse(string)
    Unparser::Preprocessor.run(Unparser.parse(string))
  end

  def parse_expression(string)
    Mutant::Config::DEFAULT.expression_parser.apply(string).from_right
  end
end # ParserHelper

module XSpecHelper
  def verify_events
    expectations = raw_expectations
      .map(&XSpec::MessageExpectation.method(:parse))

    XSpec::ExpectationVerifier.verify(self, expectations) do
      yield
    end
  end

  def undefined
    double('undefined')
  end
end # XSpecHelper

RSpec.configure do |config|
  config.extend(SharedContext)
  config.include(ParserHelper)
  config.include(Mutant::AST::Sexp)
  config.include(XSpecHelper)
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mutant-0.9.9 spec/spec_helper.rb
mutant-0.9.8 spec/spec_helper.rb
mutant-0.9.7 spec/spec_helper.rb
mutant-0.9.6 spec/spec_helper.rb
mutant-0.9.5 spec/spec_helper.rb
mutant-0.9.4 spec/spec_helper.rb
mutant-0.9.3 spec/spec_helper.rb
mutant-0.9.2 spec/spec_helper.rb
mutant-0.9.1 spec/spec_helper.rb
mutant-0.9.0 spec/spec_helper.rb