Sha256: 0ae27b14520ae24d0e6ce659ae2687cfa36bccae68d51681290ad2910a670a37

Contents?: true

Size: 720 Bytes

Versions: 14

Compression:

Stored size: 720 Bytes

Contents

#!/usr/bin/env rspec

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

14 entries across 14 versions & 2 rubygems

Version Path
facter-1.6.13 spec/unit/util/config_spec.rb
facter-1.6.13.rc1 spec/unit/util/config_spec.rb
facter-1.6.12 spec/unit/util/config_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/facter-1.6.11/spec/unit/util/config_spec.rb
facter-1.6.12.rc2 spec/unit/util/config_spec.rb
facter-1.6.12.rc1 spec/unit/util/config_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/facter-1.6.11/spec/unit/util/config_spec.rb
facter-1.6.11 spec/unit/util/config_spec.rb
facter-1.6.10 spec/unit/util/config_spec.rb
facter-1.6.9 spec/unit/util/config_spec.rb
facter-1.6.8 spec/unit/util/config_spec.rb
facter-1.6.7 spec/unit/util/config_spec.rb
facter-1.6.6 spec/unit/util/config_spec.rb
facter-1.6.5 spec/unit/util/config_spec.rb