Sha256: ca874c0a468f49d77e71cabbdfb3303b8cc387746bc9262b53fdd88a2be7ddde

Contents?: true

Size: 912 Bytes

Versions: 18

Compression:

Stored size: 912 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

18 entries across 18 versions & 1 rubygems

Version Path
shuttle-deploy-0.3.0.beta1 spec/target_spec.rb
shuttle-deploy-0.2.3 spec/target_spec.rb
shuttle-deploy-0.2.2 spec/target_spec.rb
shuttle-deploy-0.2.1 spec/target_spec.rb
shuttle-deploy-0.2.0 spec/target_spec.rb
shuttle-deploy-0.2.0.beta16 spec/target_spec.rb
shuttle-deploy-0.2.0.beta15 spec/target_spec.rb
shuttle-deploy-0.2.0.beta14 spec/target_spec.rb
shuttle-deploy-0.2.0.beta13 spec/target_spec.rb
shuttle-deploy-0.2.0.beta12 spec/target_spec.rb
shuttle-deploy-0.2.0.beta11 spec/target_spec.rb
shuttle-deploy-0.2.0.beta10 spec/target_spec.rb
shuttle-deploy-0.2.0.beta9 spec/target_spec.rb
shuttle-deploy-0.2.0.beta7 spec/target_spec.rb
shuttle-deploy-0.2.0.beta6 spec/target_spec.rb
shuttle-deploy-0.2.0.beta5 spec/target_spec.rb
shuttle-deploy-0.2.0.beta4 spec/target_spec.rb
shuttle-deploy-0.2.0.beta3 spec/target_spec.rb