Sha256: 775ce20d0f0949807bc4624c0181ffe25757ea3d38a972fd22b2aea3700fb60a

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

require 'drbqs/manage/ssh_shell'

describe DRbQS::Manage::SSHShell do
  it "should split destination" do
    ssh = DRbQS::Manage::SSHShell.new('user@hostname')
    ssh.user.should == 'user'
    ssh.host.should == 'hostname'
    ssh.port.should be_nil
    ssh.directory.should be_nil
  end

  it "should split destination including directory" do
    ssh = DRbQS::Manage::SSHShell.new('user@hostname:22', :directory => '/path/to/directory')
    ssh.user.should == 'user'
    ssh.host.should == 'hostname'
    ssh.port.should == 22
    ssh.directory.should == '/path/to/directory'
  end

  it "should raise error: not include '@'" do
    lambda do
      DRbQS::Manage::SSHShell.new('userhostname')
    end.should raise_error
  end

  it "should raise error: empty user name" do
    lambda do
      DRbQS::Manage::SSHShell.new('@hostname')
    end.should raise_error
  end

  it "should raise error: empty host name" do
    lambda do
      DRbQS::Manage::SSHShell.new('user:22')
    end.should raise_error
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
drbqs-0.1.1 spec/manage/ssh_shell_spec.rb
drbqs-0.1.0 spec/manage/ssh_shell_spec.rb
drbqs-0.0.19 spec/manage/ssh_shell_spec.rb
drbqs-0.0.18 spec/manage/ssh_shell_spec.rb
drbqs-0.0.17 spec/manage/ssh_shell_spec.rb
drbqs-0.0.16 spec/manage/ssh_shell_spec.rb
drbqs-0.0.15 spec/manage/ssh_shell_spec.rb