Sha256: a04b7baf3295928fb565386cdc1479e5e1e49e4c118a41b74c9c261413e9d479

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

module PSWindows
  describe Host do
    let(:options)  { @options ? @options : {} }
    let(:platform) do
      if @platform
        { :platform => Beaker::Platform.new(@platform) }
      else
        { :platform => Beaker::Platform.new('windows-vers-arch-extra') }
      end
    end
    let(:host) do
      opts = options.merge(platform)
      opts[:is_cygwin] = false
      make_host('name', opts)
    end

    describe '#external_copy_base' do
      it 'returns previously calculated value if set' do
        external_copy_base_before = host.instance_variable_get(:@external_copy_base)
        test_value = :testn8391
        host.instance_variable_set(:@external_copy_base, test_value)

        expect(host).not_to receive(:execute)
        expect(host.external_copy_base).to be === test_value
        host.instance_variable_set(:@external_copy_base, external_copy_base_before)
      end

      it 'calls the correct command if unset' do
        expect(host).to receive(:execute).with(/^for\ .*ALLUSERSPROFILE.*\%\~I$/)
        host.external_copy_base
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
beaker-6.4.1 spec/beaker/host/pswindows_spec.rb
beaker-6.4.0 spec/beaker/host/pswindows_spec.rb
beaker-6.3.0 spec/beaker/host/pswindows_spec.rb
beaker-6.2.0 spec/beaker/host/pswindows_spec.rb
beaker-6.1.0 spec/beaker/host/pswindows_spec.rb
beaker-5.8.1 spec/beaker/host/pswindows_spec.rb
beaker-5.8.0 spec/beaker/host/pswindows_spec.rb
beaker-5.7.0 spec/beaker/host/pswindows_spec.rb
beaker-5.6.0 spec/beaker/host/pswindows_spec.rb
beaker-5.5.0 spec/beaker/host/pswindows_spec.rb
beaker-5.4.0 spec/beaker/host/pswindows_spec.rb
beaker-5.3.1 spec/beaker/host/pswindows_spec.rb
beaker-5.3.0 spec/beaker/host/pswindows_spec.rb
beaker-5.2.0 spec/beaker/host/pswindows_spec.rb
beaker-5.1.0 spec/beaker/host/pswindows_spec.rb
beaker-5.0.0 spec/beaker/host/pswindows_spec.rb