Sha256: 42e6abdf591a8ba920b2bed1e2ee7b8211f3b69d7e0b46ac3b2de41afb995fe5

Contents?: true

Size: 1.48 KB

Versions: 11

Compression:

Stored size: 1.48 KB

Contents

require 'spec_helper_system'

describe "rcp:" do
  it 'check it works with block matchers' do
    rcp(
      :sp => fixture_root + 'example_dir',
      :dp => '/tmp/example_destination1'
    ) do |r|
      r.success.should be_true
    end

    shell 'cat /tmp/example_destination1/example_file' do |r|
      r.exit_code.should be_zero
      r.stdout.should =~ /Test content 1234/
    end
  end

  it 'check it works outside a block' do
    r = rcp(
      :sp => fixture_root + 'example_dir',
      :dp => '/tmp/example_destination2'
    )
    r.success.should be_true

    shell 'cat /tmp/example_destination2/example_file' do |r|
      r.exit_code.should be_zero
      r.stdout.should =~ /Test content 1234/
    end
  end

  it 'should support being passed a node as a string' do |r|
    r = rcp(
      :sp => fixture_root + 'example_dir',
      :dp => '/tmp/example_destination3',
      :destination_node => 'main',
    )
    r.success.should be_true

    shell 'cat /tmp/example_destination3/example_file' do |r|
      r.exit_code.should be_zero
      r.stdout.should =~ /Test content 1234/
    end
  end

  it 'should support being passed a node as an object' do |r|
    r = rcp(
      :sp => fixture_root + 'example_dir',
      :dp => '/tmp/example_destination3',
      :destination_node => node(:name => 'main'),
    )
    r.success.should be_true

    shell 'cat /tmp/example_destination3/example_file' do |r|
      r.exit_code.should be_zero
      r.stdout.should =~ /Test content 1234/
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rspec-system-2.8.0 spec/system/rcp_spec.rb
rspec-system-2.7.2 spec/system/rcp_spec.rb
rspec-system-2.7.1 spec/system/rcp_spec.rb
rspec-system-2.7.0 spec/system/rcp_spec.rb
rspec-system-2.6.0 spec/system/rcp_spec.rb
rspec-system-2.5.1 spec/system/rcp_spec.rb
rspec-system-2.5.0 spec/system/rcp_spec.rb
rspec-system-2.4.0 spec/system/rcp_spec.rb
rspec-system-2.3.0 spec/system/rcp_spec.rb
rspec-system-2.2.1 spec/system/rcp_spec.rb
rspec-system-2.2.0 spec/system/rcp_spec.rb