Sha256: fbabf0e07a07973fcadd0fcf1bf173a3fabb57628c1d794440b28ee2734c789c

Contents?: true

Size: 1.49 KB

Versions: 47

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'

module Beaker
  describe Windows::Pkg do
    class WindowsPkgTest
      include Windows::Pkg

      def initialize(hash, logger)
        @hash = hash
        @logger = logger
      end

      def [](k)
        @hash[k]
      end

      def to_s
        "me"
      end

      def exec
        #noop
      end

    end

    let (:opts)     { @opts || {} }
    let (:logger)   { double( 'logger' ).as_null_object }
    let (:instance) { WindowsPkgTest.new(opts, logger) }

    describe '#install_package' do
      before :each do
        allow( instance ).to receive( :identify_windows_architecture )
      end

      context 'cygwin does not exist' do
        before :each do
          allow( instance ).to receive( :check_for_command ).and_return( false )
        end

        it 'curls the SSL URL for cygwin\'s installer' do
          expect( instance ).to receive( :execute ).with( /^curl.*https\:/  ).ordered
          allow(  instance ).to receive( :execute ).with( /^setup\-x86/     ).ordered
          instance.install_package( 'curl' )
        end

        it 'falls back to the non-SSL URL if that one fails' do
          allow(  instance ).to receive( :execute ).with( /^curl.*https\:/  ).and_raise( Beaker::Host::CommandFailure ).ordered
          expect( instance ).to receive( :execute ).with( /^curl.*http\:/   ).ordered
          allow(  instance ).to receive( :execute ).with( /^setup\-x86/     ).ordered
          instance.install_package( 'curl' )
        end
      end
    end

  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
beaker-3.20.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.19.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.18.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.17.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.16.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.15.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.14.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.13.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.12.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.11.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.10.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.9.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.8.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.7.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.6.0 spec/beaker/host/windows/pkg_spec.rb
beaker-2.52.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.5.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.4.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.3.0 spec/beaker/host/windows/pkg_spec.rb
beaker-3.2.0 spec/beaker/host/windows/pkg_spec.rb