Sha256: cfdd1ac12aac362a13e57b9109d04f551e0889fdbc5411feb9c0334afaf7d1cb

Contents?: true

Size: 1019 Bytes

Versions: 5

Compression:

Stored size: 1019 Bytes

Contents

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

require 'drbqs/ssh/shell'

describe DRbQS::SSHShell do
  it "should split destination" do
    ssh = DRbQS::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::SSHShell.new('user@hostname:22', :dir => '/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::SSHShell.new('userhostname')
    end.should raise_error
  end

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

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

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
drbqs-0.0.13 spec/ssh_shell_spec.rb
drbqs-0.0.12 spec/ssh_shell_spec.rb
drbqs-0.0.11 spec/ssh_shell_spec.rb
drbqs-0.0.10 spec/ssh_shell_spec.rb
drbqs-0.0.9 spec/ssh_shell_spec.rb