Sha256: fffd32f7377c553a549941d79257fe5d9ce8e4777213e2a31b8cb2002b0ac020

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

module KnapsackPro
  module Adapters
    class BaseAdapter
      # Just example, please overwrite constant in subclass
      TEST_DIR_PATTERN = 'test/**{,/*/**}/*_test.rb'

      def self.bind
        adapter = new
        adapter.bind
        adapter
      end

      def bind
        if KnapsackPro::Config::Env.recording_enabled?
          KnapsackPro.logger.debug('Test suite time execution recording enabled.')
          bind_time_tracker
          bind_save_report
        end

        if KnapsackPro::Config::Env.queue_recording_enabled?
          KnapsackPro.logger.debug('Test suite time execution queue recording enabled.')
          bind_before_queue_hook
          bind_time_tracker
          bind_save_queue_report
        end
      end

      def bind_time_tracker
        raise NotImplementedError
      end

      def bind_save_report
        raise NotImplementedError
      end

      def bind_save_queue_report
        raise NotImplementedError
      end

      def bind_before_queue_hook
        raise NotImplementedError
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
knapsack_pro-0.46.0 lib/knapsack_pro/adapters/base_adapter.rb
knapsack_pro-0.45.0 lib/knapsack_pro/adapters/base_adapter.rb