Sha256: 171ea126f81baf8799e65ad20d937987f057b98abd9c95a87a7b6001b218ec5a

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

require 'pathname'

require 'result'
require 'engineyard-serverside/callbacks/executor'

module EY
  module Serverside
    module Callbacks

      describe Executor do
        let(:config) {Object.new}
        let(:shell) {Object.new}
        let(:ruby_hook) {Object.new}
        let(:executable_hook) {Object.new}
        let(:hooks) {[ruby_hook, executable_hook]}

        before(:each) do
          allow(ruby_hook).to receive(:flavor).and_return(:ruby)
          allow(executable_hook).to receive(:flavor).and_return(:executable)
        end

        describe '.execute' do
          let(:result) {described_class.execute(config, shell, hooks)}

          it 'dispatches each hook to the proper executor' do
            expect(described_class::Ruby).
              to receive(:execute).
              with(config, shell, ruby_hook)

            expect(described_class::Executable).
              to receive(:execute).
              with(config, shell, executable_hook)

            result
          end

        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
engineyard-serverside-3.0.4 spec/engineyard-serverside/callbacks/executor_spec.rb
engineyard-serverside-3.0.3 spec/engineyard-serverside/callbacks/executor_spec.rb
engineyard-serverside-2.8.0 spec/engineyard-serverside/callbacks/executor_spec.rb