summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..80e5bc6
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,20 @@
+require 'rspec'
+
+RSpec.configure do |config|
+ config.color = true
+end
+
+unless RUBY_ENGINE == 'jruby'
+ require 'simplecov'
+
+ formatters = [SimpleCov::Formatter::HTMLFormatter]
+ if ENV['CODACY_PROJECT_TOKEN']
+ require 'codacy-coverage'
+ formatters << Codacy::Formatter
+ end
+
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(formatters)
+ SimpleCov.start do
+ add_filter '/spec/'
+ end
+end