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.122.3 spec/lib/packaging/util/os_spec.rb
packaging-0.122.2 spec/lib/packaging/util/os_spec.rb
packaging-0.122.1 spec/lib/packaging/util/os_spec.rb
packaging-0.122.0 spec/lib/packaging/util/os_spec.rb
packaging-0.121.0 spec/lib/packaging/util/os_spec.rb
packaging-0.120.0 spec/lib/packaging/util/os_spec.rb
packaging-0.118.0 spec/lib/packaging/util/os_spec.rb
packaging-0.117.0 spec/lib/packaging/util/os_spec.rb
packaging-0.116.0 spec/lib/packaging/util/os_spec.rb
packaging-0.115.0 spec/lib/packaging/util/os_spec.rb
packaging-0.114.0 spec/lib/packaging/util/os_spec.rb
packaging-0.113.0 spec/lib/packaging/util/os_spec.rb
packaging-0.112.0 spec/lib/packaging/util/os_spec.rb
packaging-0.111.0 spec/lib/packaging/util/os_spec.rb
packaging-0.110.1 spec/lib/packaging/util/os_spec.rb
packaging-0.110.0 spec/lib/packaging/util/os_spec.rb
packaging-0.109.7 spec/lib/packaging/util/os_spec.rb
packaging-0.109.6 spec/lib/packaging/util/os_spec.rb
packaging-0.109.5 spec/lib/packaging/util/os_spec.rb
packaging-0.109.4 spec/lib/packaging/util/os_spec.rb