Sha256: d34b5491928384c82415e77eb9d2ce9d5f75535b266610d9fecc23a4d08870e4

Contents?: true

Size: 1.62 KB

Versions: 10

Compression:

Stored size: 1.62 KB

Contents

require 'spec_helper'
require 'albacore/plink'

describe PLink, 'when executing a command over plink' do
  before :each do
    @cmd = PLink.new
    @cmd.extend(SystemPatch)
    @cmd.extend(FailPatch)
    @cmd.command ="C:\\plink.exe"
    @cmd.host = "testhost"

  end

  it "should attempt to execute plink.exe" do
    @cmd.run
    @cmd.system_command.should include("plink.exe")
  end

  it "should attempt to connect to the test host on the default port (22)"  do
    @cmd.run
    @cmd.system_command.should include("@testhost")
    @cmd.system_command.should include("-P 22")
  end

  it "should connect to the test host on a non default port 2200" do
    @cmd.port = 2200
    @cmd.run
    @cmd.system_command.should include("-P 2200")
  end

  it "should connect to the host with a username" do
    expected_user = "dummyuser"
    @cmd.user = expected_user
    @cmd.run
    @cmd.system_command.should include("#{expected_user}@")
  end

  it "should run remote commands in batch mode" do
    @cmd.run
    @cmd.system_command.should include("-batch")
  end

  it "should run commands in verbose mode" do
    @cmd.verbose = true
    @cmd.run
    @cmd.system_command.should include("-v")
  end

  it "should include the remote command" do
    expected_remote_exe = "C:\ThisIsTheRemoteExe.exe"
    @cmd.commands expected_remote_exe
    @cmd.run
    @cmd.system_command.should include(expected_remote_exe)
  end

  it "should include the remote command with parameters" do
    expected_remote_exe = "C:\\ThisIsTheRemoteExe.exe --help -o -p"
    @cmd.commands expected_remote_exe
    @cmd.run
    @cmd.system_command.should include(expected_remote_exe)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
albacore-0.3.6 spec/plink_spec.rb
albacore-1.0.0.rc.2 spec/plink_spec.rb
albacore-1.0.0.rc.1 spec/plink_spec.rb
albacore-0.3.5 spec/plink_spec.rb
albacore-0.3.4 spec/plink_spec.rb
albacore-0.3.3 spec/plink_spec.rb
albacore-0.3.2 spec/plink_spec.rb
albacore-0.3.1 spec/plink_spec.rb
albacore-0.3.0 spec/plink_spec.rb
albacore-0.2.6 spec/plink_spec.rb