Sha256: 55303cb3003971a3656d7a630655f0e61ced1533ef4af7326a6a35084d40e0e5
Contents?: true
Size: 1.18 KB
Versions: 9
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require 'test_helper' module Shipit class ShipitTaskExecutionStrategyTest < ActiveSupport::TestCase setup do class FakeExecutionStrategy < Shipit::TaskExecutionStrategy::Base def execute; end end end teardown do Shipit.task_execution_strategy = nil Object.send(:remove_const, :FakeExecutionStrategy) if Object.const_defined?(:FakeExecutionStrategy) end test "uses the default strategy" do Shipit.task_execution_strategy = nil assert_equal Shipit::TaskExecutionStrategy::Default, Shipit.task_execution_strategy end test "allows registration of an execution strategy" do strategy = FakeExecutionStrategy Shipit.task_execution_strategy = strategy assert_equal( strategy, Shipit.task_execution_strategy ) end test "the registered execution strategy is invoked during execution of a task" do task_type = Shipit::Deploy task = task_type.new strategy = FakeExecutionStrategy strategy.any_instance.expects(:execute) Shipit.task_execution_strategy = strategy Shipit::PerformTaskJob.new.perform(task) end end end
Version data entries
9 entries across 9 versions & 1 rubygems