2013-07-28 18:44:26 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
if ENV['COVERAGE'] == 'true'
|
|
|
|
require 'simplecov'
|
|
|
|
|
|
|
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|
|
|
SimpleCov::Formatter::HTMLFormatter,
|
|
|
|
]
|
|
|
|
|
|
|
|
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-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
|
|
|
|
|
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'
|
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
|
|
|
|
AST_CACHE = Mutant::Cache.new
|
|
|
|
end
|
|
|
|
|
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)
|
2013-06-04 16:16:04 -04:00
|
|
|
config.include(Mutant::NodeHelpers)
|
2013-09-10 00:45:25 -04:00
|
|
|
config.expect_with :rspec do |rspec|
|
2014-01-19 15:42:21 -05:00
|
|
|
rspec.syntax = :expect
|
2013-07-14 19:17:15 -04:00
|
|
|
end
|
2012-07-23 10:37:44 -04:00
|
|
|
end
|