Sha256: 3d3d6590444ec54b33f3582060f72f468a7672e9ae4fe3c38e35a98f222a67fd

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

$LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)

# Has to be the first file required so that all other files show coverage information
require 'simplecov'

# Standard Library
require 'fileutils'
require 'pathname'

# Gems
require 'aruba/cucumber'
require 'rspec/expectations'

Before do |scenario|
  command_name = case scenario
                 when Cucumber::RunningTestCase::Scenario
                   "#{scenario.feature.title} #{scenario.name}"
                 else
                   raise TypeError.new("Don't know how to extract command name from #{scenario.class}")
                 end

  # Used in simplecov_setup so that each scenario has a different name and their coverage results are merged instead
  # of overwriting each other as 'Cucumber Features'
  set_env('SIMPLECOV_COMMAND_NAME', command_name)

  simplecov_setup_pathname = Pathname.new(__FILE__).expand_path.parent.join('simplecov_setup')
  # set environment variable so child processes will merge their coverage data with parent process's coverage data.
  set_env('RUBYOPT', "-r#{simplecov_setup_pathname} #{ENV['RUBYOPT']}")
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aruba-0.7.4 features/support/env.rb
aruba-0.7.3 features/support/env.rb
aruba-0.7.2 features/support/env.rb
aruba-0.7.1 features/support/env.rb
aruba-0.7.0 features/support/env.rb