Sha256: ff0f5b11cf7c3b3439903c27602aefb3fd9686c9ea8d273dcf65ae848aee7453

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

require 'acceptance_spec_helper'

feature "connect to server" do
  scenario "reach server via ssh" do
    create_config <<-CONFIG
      project :slots do
        environment :staging do
          server :s1 do
            host "1.2.3.4"
            user "deployer"
            location "/var/apps/slots"
          end

          server :s2 do
            host "2.3.4.5"
          end
        end
      end
    CONFIG

    run "taketo slots:staging:s1 --dry-run"
    stdout.should == %Q{ssh -t deployer@1.2.3.4 "cd /var/apps/slots; RAILS_ENV=staging bash"}
    stderr.should be_empty
    exit_status.should be_success
  end

  scenario "ssh to the only server" do
    create_config <<-CONFIG
      project :slots do
        environment :staging do
          server do
            host "1.2.3.4"
            location "/var/apps/slots"
          end
        end
      end
    CONFIG

    run "taketo --dry-run"
    stdout.should == %Q{ssh -t 1.2.3.4 "cd /var/apps/slots; RAILS_ENV=staging bash"}
    stderr.should be_empty
    exit_status.should be_success
  end

  scenario "ssh without password" do
    create_config <<-CONFIG
      project :slots do
        environment :staging do
          server do
            identity_file "/home/gor/.ssh/foo bar"
            host "2.3.4.5"
          end
        end
      end
    CONFIG

    run "taketo --dry-run"
    stdout.should == %q{ssh -t -i /home/gor/.ssh/foo\ bar 2.3.4.5 "RAILS_ENV=staging bash"}
    stderr.should be_empty
    exit_status.should be_success
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
taketo-0.2.0 spec/acceptance/connect_to_server_spec.rb
taketo-0.2.0.alpha spec/acceptance/connect_to_server_spec.rb