Sha256: 796aabc554c58508bd5ebf7a97bf0d793eae793e689cb48457f2118d86ccc820

Contents?: true

Size: 920 Bytes

Versions: 5

Compression:

Stored size: 920 Bytes

Contents

require 'spec_helper'

describe Shuttle::Target do
  let(:target) { Shuttle::Target.new(attributes) }

  describe '#connection' do
    let(:attributes) do
      { :host => 'host.com', :user => 'user', :password => 'password' }
    end

    it 'returns a new ssh session connection' do
      expect(target.connection).to be_a Net::SSH::Session
    end
  end

  describe '#validate!' do
    context 'with valid attributes' do
      let(:attributes) do
        {:host => 'host.com', :user => 'user', :deploy_to => '/home'}
      end

      it 'does not raise errors' do
        expect { target.validate! }.not_to raise_error
      end
    end

    context 'with incomplete attributes' do
      let(:attributes) do
        {:host => 'host.com', :user => 'user'}
      end

      it 'raises error' do
        expect { target.validate! }.to raise_error Shuttle::ConfigError, "Deploy path required" 
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shuttle-deploy-0.4.0 spec/target_spec.rb
shuttle-deploy-0.3.3 spec/target_spec.rb
shuttle-deploy-0.3.2 spec/target_spec.rb
shuttle-deploy-0.3.1 spec/target_spec.rb
shuttle-deploy-0.3.0 spec/target_spec.rb