Sha256: ef80afdcb73cd3cae5602052cea24a735e2784e5d466fdecb0946b6f1f5c4a5f

Contents?: true

Size: 873 Bytes

Versions: 126

Compression:

Stored size: 873 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.debug(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

126 entries across 126 versions & 1 rubygems

Version Path
knapsack_pro-1.22.3 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.22.2 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.22.1 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.22.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.21.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.20.2 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.20.1 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.20.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.19.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.18.2 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.18.1 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.18.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.17.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.16.1 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.16.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.15.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.14.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.13.0 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.12.1 lib/knapsack_pro/adapters/spinach_adapter.rb
knapsack_pro-1.12.0 lib/knapsack_pro/adapters/spinach_adapter.rb