Sha256: a4e739742796ac09c108423081de4bd8109b11a97fcd8e1023bbc474844ea505

Contents?: true

Size: 720 Bytes

Versions: 11

Compression:

Stored size: 720 Bytes

Contents

#! /usr/bin/env ruby

require 'spec_helper'
require 'facter/util/config'

describe Facter::Util::Config do
  describe "is_windows? function" do
    it "should detect windows if RbConfig returns a windows OS" do
      host_os = ["mswin","win32","dos","mingw","cygwin"]
      host_os.each do |h|
        RbConfig::CONFIG.expects(:[]).with('host_os').returns(h)
        Facter::Util::Config.is_windows?.should be_true
      end
    end

    it "should not detect windows if RbConfig returns a non-windows OS" do
      host_os = ["darwin","linux"]
      host_os.each do |h|
        RbConfig::CONFIG.expects(:[]).with('host_os').returns(h)
        Facter::Util::Config.is_windows?.should be_false
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/spec/unit/util/config_spec.rb
facter-1.6.18 spec/unit/util/config_spec.rb
facter-1.6.18.rc1 spec/unit/util/config_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/spec/unit/util/config_spec.rb
facter-1.6.17 spec/unit/util/config_spec.rb
facter-1.6.17.rc1 spec/unit/util/config_spec.rb
facter-1.6.16 spec/unit/util/config_spec.rb
facter-1.6.15 spec/unit/util/config_spec.rb
facter-1.6.15.rc1 spec/unit/util/config_spec.rb
facter-1.6.14 spec/unit/util/config_spec.rb
facter-1.6.14.rc1 spec/unit/util/config_spec.rb