Sha256: 1f6cae7bb462a19852573558a6d263182bb6002bb95bcb6ea212592922ef116d

Contents?: true

Size: 692 Bytes

Versions: 39

Compression:

Stored size: 692 Bytes

Contents

require 'dynflow/testing'
module ForemanTasks
  module TestHelpers
    def self.test_in_thread_world
      return @test_in_thread_world if @test_in_thread_world
      world_config = ForemanTasks.dynflow.config.world_config
      @test_in_thread_world = ::Dynflow::Testing::InThreadWorld.new(world_config)
    end

    module WithInThreadExecutor
      extend ActiveSupport::Concern
      included do
        setup do
          @old_dynflow_world = ForemanTasks.dynflow.world
          ForemanTasks.dynflow.world = ForemanTasks::TestHelpers.test_in_thread_world
        end

        teardown do
          ForemanTasks.dynflow.world = @old_dynflow_world
        end
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
foreman-tasks-0.14.6 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.15.1 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.15.0 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.14.5 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.14.4 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.14.3 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.14.2 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.14.1 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.11.3 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.14.0 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.13.4 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.13.3 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.13.2 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.13.1 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.13.0 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.12.2 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.11.2 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.12.1 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.12.0 lib/foreman_tasks/test_helpers.rb
foreman-tasks-0.11.1 lib/foreman_tasks/test_helpers.rb