summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-26 19:27:30 -0600
committerLuke Kanies <luke@madstop.com>2007-11-26 19:27:30 -0600
commit12ebbe2442e8f05585fb1c0bd9dcbe052fd59ba7 (patch)
treeb437db22033e6ff7310675eda781097803e4fa9a /spec/integration
parentfc7f1b4f70d8e4b62852a0da0af21fcb67a1a89c (diff)
Rewriting the tests for the package resource type, fixing #930.
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/ral/types/package.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/integration/ral/types/package.rb b/spec/integration/ral/types/package.rb
new file mode 100755
index 000000000..20567629d
--- /dev/null
+++ b/spec/integration/ral/types/package.rb
@@ -0,0 +1,24 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../../spec_helper'
+
+require 'puppet/type/package'
+
+describe Puppet::Type::Package, "when choosing a default package provider" do
+ before do
+ # the default provider is cached.
+ Puppet::Type::Package.defaultprovider = nil
+ end
+
+ def provider_name(os)
+ {"Debian" => :apt, "Darwin" => :apple, "RedHat" => :up2date, "Fedora" => :yum, "FreeBSD" => :ports, "OpenBSD" => :openbsd, "Solaris" => :sun}[os]
+ end
+
+ it "should have a default provider" do
+ Puppet::Type::Package.defaultprovider.should_not be_nil
+ end
+
+ it "should choose the correct provider each platform" do
+ Puppet::Type::Package.defaultprovider.name.should == provider_name(Facter.value(:operatingsystem))
+ end
+end