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.99.81 spec/lib/packaging/util/os_spec.rb
packaging-0.99.80 spec/lib/packaging/util/os_spec.rb
packaging-0.99.79 spec/lib/packaging/util/os_spec.rb
packaging-0.99.78 spec/lib/packaging/util/os_spec.rb
packaging-0.99.77 spec/lib/packaging/util/os_spec.rb
packaging-0.88.77 spec/lib/packaging/util/os_spec.rb
packaging-0.99.76 spec/lib/packaging/util/os_spec.rb
packaging-0.99.75 spec/lib/packaging/util/os_spec.rb
packaging-0.99.74 spec/lib/packaging/util/os_spec.rb
packaging-0.99.73 spec/lib/packaging/util/os_spec.rb
packaging-0.99.72 spec/lib/packaging/util/os_spec.rb
packaging-0.99.71 spec/lib/packaging/util/os_spec.rb
packaging-0.99.70 spec/lib/packaging/util/os_spec.rb
packaging-0.99.69 spec/lib/packaging/util/os_spec.rb
packaging-0.99.68 spec/lib/packaging/util/os_spec.rb
packaging-0.99.67 spec/lib/packaging/util/os_spec.rb
packaging-0.99.66 spec/lib/packaging/util/os_spec.rb
packaging-0.99.65 spec/lib/packaging/util/os_spec.rb
packaging-0.99.64 spec/lib/packaging/util/os_spec.rb
packaging-0.99.63 spec/lib/packaging/util/os_spec.rb