Sha256: 724c3daa060511e70e0ade192cd65a5a1762ed41597fce9cb790930d4edbe23d

Contents?: true

Size: 872 Bytes

Versions: 26

Compression:

Stored size: 872 Bytes

Contents

module KnapsackPro
  module Adapters
    class SpinachAdapter < BaseAdapter
      TEST_DIR_PATTERN = 'features/**{,/*/**}/*.feature'

      def self.test_path(scenario)
        scenario.feature.filename
      end

      def bind_time_tracker
        ::Spinach.hooks.before_scenario do |scenario_data, step_definitions|
          KnapsackPro.tracker.current_test_path = KnapsackPro::Adapters::SpinachAdapter.test_path(scenario_data)
          KnapsackPro.tracker.start_timer
        end

        ::Spinach.hooks.after_scenario do
          KnapsackPro.tracker.stop_timer
        end

        ::Spinach.hooks.after_run do
          KnapsackPro.logger.info(KnapsackPro::Presenter.global_time)
        end
      end

      def bind_save_report(latest_error = nil)
        ::Spinach.hooks.after_run do
          KnapsackPro::Report.save
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
knapsack_pro-0.30.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.29.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.28.1 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.28.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.27.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.26.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.25.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.24.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.23.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.22.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.21.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.20.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.19.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.18.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.17.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.16.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.15.2 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.15.1 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.15.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-0.14.0 lib/knapsack_pro/adapters/spinach_adapter.rb