Sha256: 59ce5d8308e5e986d8184e1bf976314fdcf7bbf9c899871c486a7b3d671f0eaa

Contents?: true

Size: 730 Bytes

Versions: 2

Compression:

Stored size: 730 Bytes

Contents

module Cucover
  module ExampleRowExtensions
    def file_colon_line
      "#{file}:#{line}"
    end
    
    def file
      @scenario_outline.file_colon_line.split(':').first
    end
  end
end

Cucover::Monkey.extend_every Cucumber::Ast::OutlineTable::ExampleRow => Cucover::ExampleRowExtensions

Before do |scenario_or_table_row|
  Cucover.logger.info("Starting #{scenario_or_table_row.class} #{scenario_or_table_row.file_colon_line}")
  Cucover::Rails.patch_if_necessary
  
  if Cucover.should_execute?(scenario_or_table_row)
    Cucover.start_recording!(scenario_or_table_row)
  else
    announce "[ Cucover - Skipping clean scenario ]"
    scenario_or_table_row.skip_invoke!
  end
end

After do
  Cucover.stop_recording!
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mattwynne-cucover-0.1.0 lib/cucover/cucumber_hooks.rb
mattwynne-cucover-0.1.1 lib/cucover/cucumber_hooks.rb