Sha256: f519fa4012240f747e1e6a55348037413dfc9ffec42dea6f8cf8fbbbc896be5f

Contents?: true

Size: 1.65 KB

Versions: 3

Compression:

Stored size: 1.65 KB

Contents

require 'spec_helper'

require 'engineyard-serverside/cli/workflows/helpers'

class Helpful
  include EY::Serverside::CLI::Workflows::Helpers
end

module EY
  module Serverside
    module CLI
      module Workflows
        describe Helpers do
          let(:config) {Object.new}
          let(:shell) {Object.new}
          let(:servers) {Object.new}
          let(:workflow) {Helpful.new}

          before(:each) do
            allow(shell).to receive(:fatal)
            allow(shell).to receive(:debug)

            allow(config).to receive(:verbose)
            allow(config).to receive(:app)

            allow(workflow).to receive(:shell).and_return(shell)
            allow(workflow).to receive(:config).and_return(config)
            allow(workflow).to receive(:servers).and_return(servers)
          end

          describe '#deployer' do
            let(:result) {Object.new}
            let(:deployer) {workflow.deployer}

            it 'is a Deploy for our workflow' do
              expect(EY::Serverside::Deploy).
                to receive(:new).
                with(servers, config, shell).
                and_return(result)

              expect(deployer).to eql(result)
            end
          end

          describe '#maintenance' do
            let(:result) {Object.new}
            let(:maintenance) {workflow.maintenance}

            it 'is a Maintenance for our workflow' do
              expect(EY::Serverside::Maintenance).
                to receive(:new).
                with(servers, config, shell).
                and_return(result)

              expect(maintenance).to eql(result)
            end
          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/cli/workflows/helpers_spec.rb
engineyard-serverside-3.0.3 spec/engineyard-serverside/cli/workflows/helpers_spec.rb
engineyard-serverside-2.8.0 spec/engineyard-serverside/cli/workflows/helpers_spec.rb