diff --git a/examples/features/support/env.rb b/examples/features/support/env.rb index 38dfe06..054989e 100644 --- a/examples/features/support/env.rb +++ b/examples/features/support/env.rb @@ -2,8 +2,15 @@ require "bundler/setup" require "byebug" require "rspec/expectations" +orm = ENV['ORM'] +another_orm = ENV['ANOTHER_ORM'] +strategy = ENV['STRATEGY'] +multiple_db = ENV['MULTIPLE_DBS'] + if ENV['COVERAGE'] == 'true' require "simplecov" + simple_cov_key = "Inner Cucumber with #{[orm, another_orm, strategy, multiple_db].compact.join(", ")}" + SimpleCov.command_name simple_cov_key if ENV['CI'] == 'true' require 'codecov' @@ -17,11 +24,6 @@ end DB_DIR = "#{File.dirname(__FILE__)}/../../db" -orm = ENV['ORM'] -another_orm = ENV['ANOTHER_ORM'] -strategy = ENV['STRATEGY'] -multiple_db = ENV['MULTIPLE_DBS'] - config = YAML::load(File.open("#{File.dirname(__FILE__)}/../../config/redis.yml")) ENV['REDIS_URL'] = config['test']['url'] ENV['REDIS_URL_ONE'] = config['one']['url'] diff --git a/features/support/env.rb b/features/support/env.rb index 5b85dac..7a356c9 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,5 +1,18 @@ require 'rspec/expectations' +if ENV['COVERAGE'] == 'true' + require "simplecov" + + if ENV['CI'] == 'true' + require 'codecov' + SimpleCov.formatter = SimpleCov::Formatter::Codecov + puts "required codecov" + end + + SimpleCov.start + puts "required simplecov" +end + class FeatureRunner attr_accessor :orm attr_accessor :another_orm