[Pkg-puppet-devel] [facter] 129/180: (FACT-550) Skip macosx and posix specific tests on windows

Stig Sandbeck Mathisen ssm at debian.org
Mon Jun 30 15:06:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit 02bffa5629ee359ec881abba78a4094d68b699d3
Author: Josh Cooper <josh at puppetlabs.com>
Date:   Thu Jun 12 17:15:27 2014 -0700

    (FACT-550) Skip macosx and posix specific tests on windows
    
    Commit 5b90132ee unvendored CFPropertyList, and we expressed the
    CFPropertyList gem dependency as:
    
        gem 'CFPropertyList', :platform => ruby
    
    However, bundler interprets the `ruby` platform as "C Ruby (MRI) or
    Rubinius, but NOT Windows"[1]. This means the gem is installed everywhere,
    but Windows.
    
    This causes the macos_spec to fail on Windows, but for some reason Jenkins
    CI thinks the job passes.
    
    This commit skips testing macos_spec on windows, and skips posix_spec which
    fails due to ':' not being the PATH separator on windows.
---
 spec/unit/core/execution/posix_spec.rb | 4 ++--
 spec/unit/util/macosx_spec.rb          | 5 +++--
 spec/unit/virtual_spec.rb              | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/spec/unit/core/execution/posix_spec.rb b/spec/unit/core/execution/posix_spec.rb
index 1acd8e4..d672f91 100644
--- a/spec/unit/core/execution/posix_spec.rb
+++ b/spec/unit/core/execution/posix_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
+require 'facter/util/config'
 
-describe Facter::Core::Execution::Posix, :as_plaform => :posix do
-
+describe Facter::Core::Execution::Posix, :unless => Facter::Util::Config.is_windows? do
   describe "#search_paths" do
     it "should use the PATH environment variable plus /sbin and /usr/sbin on unix" do
       ENV.expects(:[]).with('PATH').returns "/bin:/usr/bin"
diff --git a/spec/unit/util/macosx_spec.rb b/spec/unit/util/macosx_spec.rb
index d65aa08..9b19e36 100755
--- a/spec/unit/util/macosx_spec.rb
+++ b/spec/unit/util/macosx_spec.rb
@@ -1,9 +1,10 @@
 #! /usr/bin/env ruby
 
 require 'spec_helper'
-require 'facter/util/macosx'
+require 'facter/util/config'
+require 'facter/util/macosx' unless Facter::Util::Config.is_windows?
 
-describe Facter::Util::Macosx do
+describe "Facter::Util::Macosx", :unless => Facter::Util::Config.is_windows? do
   let(:badplist) do
     '<?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb
index ae4e9bf..7e5ae12 100755
--- a/spec/unit/virtual_spec.rb
+++ b/spec/unit/virtual_spec.rb
@@ -2,7 +2,7 @@
 
 require 'spec_helper'
 require 'facter/util/virtual'
-require 'facter/util/macosx'
+require 'facter/util/macosx' unless Facter::Util::Config.is_windows?
 
 describe "Virtual fact" do
   before(:each) do
@@ -49,7 +49,7 @@ describe "Virtual fact" do
     Facter.fact(:virtual).value.should == "zlinux"
   end
 
-  describe "on Darwin" do
+  describe "on Darwin", :unless => Facter::Util::Config.is_windows? do
     before do
       Facter.fact(:kernel).stubs(:value).returns("Darwin")
     end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list