free_mutant/spec/spec_helper.rb

54 lines
1,007 B
Ruby
Raw Normal View History

2013-07-28 18:44:26 -04:00
# encoding: utf-8
if ENV['COVERAGE'] == 'true'
require 'simplecov'
require 'coveralls'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
SimpleCov.start do
command_name 'spec:unit'
add_filter 'config'
add_filter 'spec'
add_filter 'vendor'
add_filter 'test_app'
2014-03-04 11:46:45 -05:00
minimum_coverage 89.77 # TODO: raise this to 100, then mutation test
2013-07-28 18:44:26 -04:00
end
end
require 'equalizer'
require 'devtools/spec_helper'
2013-06-04 16:16:04 -04:00
require 'mutant'
$LOAD_PATH << File.join(TestApp.root, 'lib')
2012-08-14 16:45:34 -04:00
require 'test_app'
module Fixtures
AST_CACHE = Mutant::Cache.new
end
module ParserHelper
def generate(node)
Unparser.unparse(node)
end
def parse(string)
Parser::CurrentRuby.parse(string)
end
end
RSpec.configure do |config|
2012-08-16 12:02:03 -04:00
config.include(CompressHelper)
config.include(ParserHelper)
2013-06-04 16:16:04 -04:00
config.include(Mutant::NodeHelpers)
config.expect_with :rspec do |rspec|
2014-01-19 15:42:21 -05:00
rspec.syntax = :expect
end
end