Sha256: 93b336213f56f99c57014bb770d4518e6b4c6a9bce14bc315796737cdd3fb101

Contents?: true

Size: 696 Bytes

Versions: 126

Compression:

Stored size: 696 Bytes

Contents

require 'spec_helper'

describe Pkg::Util::OS do
  def as_host_os(platform, &block)
    old = RbConfig::CONFIG['host_os']
    RbConfig::CONFIG['host_os'] = platform
    begin
      yield
    ensure
      RbConfig::CONFIG['host_os'] = old
    end
  end

  it "detects windows when host_os contains mingw" do
    as_host_os('mingw32') do
      expect(Pkg::Util::OS).to be_windows
    end
  end

  it "detects windows when host_os contains mswin60" do
    as_host_os('mswin60') do
      expect(Pkg::Util::OS).to be_windows
    end
  end

  it "does not detect windows when host_os contains darwin" do
    as_host_os('darwin12.5.0') do
      expect(Pkg::Util::OS).to_not be_windows
    end
  end
end

Version data entries

126 entries across 126 versions & 1 rubygems

Version Path
packaging-0.109.3 spec/lib/packaging/util/os_spec.rb
packaging-0.109.2 spec/lib/packaging/util/os_spec.rb
packaging-0.109.1 spec/lib/packaging/util/os_spec.rb
packaging-0.109.0 spec/lib/packaging/util/os_spec.rb
packaging-0.108.2 spec/lib/packaging/util/os_spec.rb
packaging-0.108.1 spec/lib/packaging/util/os_spec.rb
packaging-0.108.0 spec/lib/packaging/util/os_spec.rb
packaging-0.107.2 spec/lib/packaging/util/os_spec.rb
packaging-0.107.1 spec/lib/packaging/util/os_spec.rb
packaging-0.107.0 spec/lib/packaging/util/os_spec.rb
packaging-0.106.3 spec/lib/packaging/util/os_spec.rb
packaging-0.106.2 spec/lib/packaging/util/os_spec.rb
packaging-0.106.1 spec/lib/packaging/util/os_spec.rb
packaging-0.106.0 spec/lib/packaging/util/os_spec.rb
packaging-0.105.0 spec/lib/packaging/util/os_spec.rb
packaging-0.104.0 spec/lib/packaging/util/os_spec.rb
packaging-0.103.0 spec/lib/packaging/util/os_spec.rb
packaging-0.102.0 spec/lib/packaging/util/os_spec.rb
packaging-0.101.0 spec/lib/packaging/util/os_spec.rb
packaging-0.99.82 spec/lib/packaging/util/os_spec.rb