2013-07-28 15:44:26 -07: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
|
2013-09-08 22:34:37 -07:00
|
|
|
command_name 'spec:unit'
|
|
|
|
|
|
|
|
add_filter 'config'
|
|
|
|
add_filter 'spec'
|
|
|
|
add_filter 'vendor'
|
|
|
|
add_filter 'test_app'
|
|
|
|
|
2014-03-04 16:46:45 +00:00
|
|
|
minimum_coverage 89.77 # TODO: raise this to 100, then mutation test
|
2013-07-28 15:44:26 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-09-08 22:34:37 -07:00
|
|
|
require 'equalizer'
|
2013-12-29 23:36:55 +01:00
|
|
|
require 'devtools/spec_helper'
|
2013-06-04 22:16:04 +02:00
|
|
|
require 'mutant'
|
2012-07-23 16:37:44 +02:00
|
|
|
|
2013-07-28 12:16:45 -07:00
|
|
|
$LOAD_PATH << File.join(TestApp.root, 'lib')
|
2012-08-14 12:27:56 +02:00
|
|
|
|
2012-08-14 22:45:34 +02:00
|
|
|
require 'test_app'
|
2012-07-26 19:25:23 +02:00
|
|
|
|
2013-06-27 22:18:07 +02:00
|
|
|
module Fixtures
|
|
|
|
AST_CACHE = Mutant::Cache.new
|
|
|
|
end
|
|
|
|
|
2013-06-04 19:22:33 +02:00
|
|
|
module ParserHelper
|
|
|
|
def generate(node)
|
|
|
|
Unparser.unparse(node)
|
|
|
|
end
|
|
|
|
|
|
|
|
def parse(string)
|
|
|
|
Parser::CurrentRuby.parse(string)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-07-31 00:48:04 +02:00
|
|
|
RSpec.configure do |config|
|
2012-08-16 18:02:03 +02:00
|
|
|
config.include(CompressHelper)
|
2013-06-04 19:22:33 +02:00
|
|
|
config.include(ParserHelper)
|
2013-06-04 22:16:04 +02:00
|
|
|
config.include(Mutant::NodeHelpers)
|
2013-09-09 21:45:25 -07:00
|
|
|
config.expect_with :rspec do |rspec|
|
2014-01-19 21:42:21 +01:00
|
|
|
rspec.syntax = :expect
|
2013-07-15 01:17:15 +02:00
|
|
|
end
|
2012-07-23 16:37:44 +02:00
|
|
|
end
|