2013-07-28 18:44:26 -04:00
|
|
|
if ENV['COVERAGE'] == 'true'
|
|
|
|
require 'simplecov'
|
|
|
|
|
|
|
|
SimpleCov.start do
|
2013-09-09 01:34:37 -04:00
|
|
|
command_name 'spec:unit'
|
|
|
|
|
|
|
|
add_filter 'config'
|
|
|
|
add_filter 'spec'
|
|
|
|
add_filter 'vendor'
|
|
|
|
add_filter 'test_app'
|
2014-06-05 13:45:49 -04:00
|
|
|
add_filter 'lib/mutant/meta/*'
|
2014-07-05 23:02:24 -04:00
|
|
|
add_filter 'lib/mutant/zombifier'
|
|
|
|
add_filter 'lib/mutant/zombifier/*'
|
2013-09-09 01:34:37 -04:00
|
|
|
|
2014-10-08 09:26:52 -04:00
|
|
|
minimum_coverage 97.64 # TODO: raise this to 100, then mutation test
|
2013-07-28 18:44:26 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-10-24 17:34:33 -04:00
|
|
|
require 'tempfile'
|
2014-04-11 21:12:49 -04:00
|
|
|
require 'concord'
|
|
|
|
require 'adamantium'
|
2013-12-29 17:36:55 -05:00
|
|
|
require 'devtools/spec_helper'
|
2014-04-11 21:12:49 -04:00
|
|
|
require 'unparser/cli'
|
2013-06-04 16:16:04 -04:00
|
|
|
require 'mutant'
|
2014-06-02 08:57:14 -04:00
|
|
|
require 'mutant/meta'
|
2014-08-10 11:06:09 -04:00
|
|
|
Devtools.init_spec_helper
|
2012-07-23 10:37:44 -04:00
|
|
|
|
2013-07-28 15:16:45 -04:00
|
|
|
$LOAD_PATH << File.join(TestApp.root, 'lib')
|
2012-08-14 06:27:56 -04:00
|
|
|
|
2012-08-14 16:45:34 -04:00
|
|
|
require 'test_app'
|
2012-07-26 13:25:23 -04:00
|
|
|
|
2013-06-27 16:18:07 -04:00
|
|
|
module Fixtures
|
2014-07-05 23:07:20 -04:00
|
|
|
TEST_CONFIG = Mutant::Config::DEFAULT.update(reporter: Mutant::Reporter::Trace.new)
|
|
|
|
TEST_CACHE = Mutant::Cache.new
|
|
|
|
TEST_ENV = Mutant::Env.new(TEST_CONFIG, TEST_CACHE)
|
2014-06-30 09:06:57 -04:00
|
|
|
end # Fixtures
|
2013-06-27 16:18:07 -04:00
|
|
|
|
2013-06-04 13:22:33 -04:00
|
|
|
module ParserHelper
|
|
|
|
def generate(node)
|
|
|
|
Unparser.unparse(node)
|
|
|
|
end
|
|
|
|
|
|
|
|
def parse(string)
|
2014-04-22 13:04:25 -04:00
|
|
|
Unparser::Preprocessor.run(Parser::CurrentRuby.parse(string))
|
2013-06-04 13:22:33 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-07-30 18:48:04 -04:00
|
|
|
RSpec.configure do |config|
|
2012-08-16 12:02:03 -04:00
|
|
|
config.include(CompressHelper)
|
2013-06-04 13:22:33 -04:00
|
|
|
config.include(ParserHelper)
|
2014-06-29 17:25:17 -04:00
|
|
|
config.include(Mutant::AST::Sexp)
|
2012-07-23 10:37:44 -04:00
|
|
|
end
|