summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-12-17 18:10:30 -0600
committerLuke Kanies <luke@madstop.com>2008-12-18 11:10:25 -0600
commitb6db54585177f277b1e06bebd4d925d5c272b610 (patch)
treead09cf88c2bd2293bee9a33d88df21734e57b8c3 /spec
parent89c25ad0661fbc1d57830f4648a3b108f4347278 (diff)
Deprecating 'Puppet.type'; replacing all instances with Puppet::Type.type
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/integration/type/file.rb6
-rw-r--r--spec/unit/other/selinux.rb6
-rwxr-xr-xspec/unit/provider/mount/parsed.rb2
-rwxr-xr-xspec/unit/provider/ssh_authorized_key/parsed.rb2
-rwxr-xr-xspec/unit/type/computer.rb2
-rwxr-xr-xspec/unit/type/file.rb10
-rwxr-xr-xspec/unit/type/macauthorization.rb2
-rwxr-xr-xspec/unit/type/user.rb4
-rwxr-xr-xspec/unit/type/zfs.rb10
-rwxr-xr-xspec/unit/util/storage.rb4
10 files changed, 24 insertions, 24 deletions
diff --git a/spec/integration/type/file.rb b/spec/integration/type/file.rb
index b6b824008..b331740d6 100755
--- a/spec/integration/type/file.rb
+++ b/spec/integration/type/file.rb
@@ -234,7 +234,7 @@ describe Puppet::Type.type(:file) do
it "should be able to create files when 'content' is specified but 'ensure' is not" do
dest = tmpfile("files_with_content")
- file = Puppet.type(:file).create(
+ file = Puppet::Type.type(:file).create(
:name => dest,
:content => "this is some content, yo"
)
@@ -249,7 +249,7 @@ describe Puppet::Type.type(:file) do
it "should create files with content if both 'content' and 'ensure' are set" do
dest = tmpfile("files_with_content")
- file = Puppet.type(:file).create(
+ file = Puppet::Type.type(:file).create(
:name => dest,
:ensure => "file",
:content => "this is some content, yo"
@@ -268,7 +268,7 @@ describe Puppet::Type.type(:file) do
File.open(source, "w") { |f| f.puts "yay" }
File.open(dest, "w") { |f| f.puts "boo" }
- file = Puppet.type(:file).create(
+ file = Puppet::Type.type(:file).create(
:name => dest,
:ensure => :absent,
:source => source
diff --git a/spec/unit/other/selinux.rb b/spec/unit/other/selinux.rb
index f024401cb..5e5568377 100644
--- a/spec/unit/other/selinux.rb
+++ b/spec/unit/other/selinux.rb
@@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/type/selboolean'
require 'puppet/type/selmodule'
-describe Puppet.type(:file), " when manipulating file contexts" do
+describe Puppet::Type.type(:file), " when manipulating file contexts" do
before :each do
@file = Puppet::Type::File.create(
:name => "/tmp/foo",
@@ -25,7 +25,7 @@ describe Puppet.type(:file), " when manipulating file contexts" do
end
end
-describe Puppet.type(:selboolean), " when manipulating booleans" do
+describe Puppet::Type.type(:selboolean), " when manipulating booleans" do
before :each do
provider_class = Puppet::Type::Selboolean.provider(Puppet::Type::Selboolean.providers[0])
Puppet::Type::Selboolean.expects(:defaultprovider).returns provider_class
@@ -54,7 +54,7 @@ describe Puppet.type(:selboolean), " when manipulating booleans" do
end
end
-describe Puppet.type(:selmodule), " when checking policy modules" do
+describe Puppet::Type.type(:selmodule), " when checking policy modules" do
before :each do
provider_class = Puppet::Type::Selmodule.provider(Puppet::Type::Selmodule.providers[0])
Puppet::Type::Selmodule.expects(:defaultprovider).returns provider_class
diff --git a/spec/unit/provider/mount/parsed.rb b/spec/unit/provider/mount/parsed.rb
index 9585afa62..6168c10d2 100755
--- a/spec/unit/provider/mount/parsed.rb
+++ b/spec/unit/provider/mount/parsed.rb
@@ -75,7 +75,7 @@ provider_class = Puppet::Type.type(:mount).provider(:parsed)
describe provider_class do
before :each do
- @mount_class = Puppet.type(:mount)
+ @mount_class = Puppet::Type.type(:mount)
@provider_class = @mount_class.provider(:parsed)
end
diff --git a/spec/unit/provider/ssh_authorized_key/parsed.rb b/spec/unit/provider/ssh_authorized_key/parsed.rb
index 21f30f97e..bf0697eb8 100755
--- a/spec/unit/provider/ssh_authorized_key/parsed.rb
+++ b/spec/unit/provider/ssh_authorized_key/parsed.rb
@@ -13,7 +13,7 @@ describe provider_class do
include PuppetTest::FileParsing
before :each do
- @sshauthkey_class = Puppet.type(:ssh_authorized_key)
+ @sshauthkey_class = Puppet::Type.type(:ssh_authorized_key)
@provider = @sshauthkey_class.provider(:parsed)
end
diff --git a/spec/unit/type/computer.rb b/spec/unit/type/computer.rb
index 43a313c5b..bfb04250b 100755
--- a/spec/unit/type/computer.rb
+++ b/spec/unit/type/computer.rb
@@ -4,7 +4,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
computer = Puppet::Type.type(:computer)
-describe Puppet.type(:computer), " when checking computer objects" do
+describe Puppet::Type.type(:computer), " when checking computer objects" do
before do
provider_class = Puppet::Type::Computer.provider(Puppet::Type::Computer.providers[0])
Puppet::Type::Computer.expects(:defaultprovider).returns provider_class
diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb
index 399181e6c..838a8b663 100755
--- a/spec/unit/type/file.rb
+++ b/spec/unit/type/file.rb
@@ -101,7 +101,7 @@ describe Puppet::Type.type(:file) do
File.open(@file, "w", 0644) { |f| f.puts "yayness"; f.flush }
File.symlink(@file, @link)
- @resource = Puppet.type(:file).create(
+ @resource = Puppet::Type.type(:file).create(
:path => @link,
:mode => "755"
)
@@ -128,12 +128,12 @@ describe Puppet::Type.type(:file) do
end
it "should be able to retrieve a stat instance for the file it is managing" do
- Puppet.type(:file).create(:path => "/foo/bar", :source => "/bar/foo").should respond_to(:stat)
+ Puppet::Type.type(:file).create(:path => "/foo/bar", :source => "/bar/foo").should respond_to(:stat)
end
describe "when stat'ing its file" do
before do
- @resource = Puppet.type(:file).create(:path => "/foo/bar")
+ @resource = Puppet::Type.type(:file).create(:path => "/foo/bar")
@resource[:links] = :manage # so we always use :lstat
end
@@ -197,13 +197,13 @@ describe Puppet::Type.type(:file) do
describe "when flushing" do
it "should flush all properties that respond to :flush" do
- @resource = Puppet.type(:file).create(:path => "/foo/bar", :source => "/bar/foo")
+ @resource = Puppet::Type.type(:file).create(:path => "/foo/bar", :source => "/bar/foo")
@resource.parameter(:source).expects(:flush)
@resource.flush
end
it "should reset its stat reference" do
- @resource = Puppet.type(:file).create(:path => "/foo/bar")
+ @resource = Puppet::Type.type(:file).create(:path => "/foo/bar")
File.expects(:lstat).times(2).returns("stat1").then.returns("stat2")
@resource.stat.should == "stat1"
@resource.flush
diff --git a/spec/unit/type/macauthorization.rb b/spec/unit/type/macauthorization.rb
index 02967e804..15690d897 100755
--- a/spec/unit/type/macauthorization.rb
+++ b/spec/unit/type/macauthorization.rb
@@ -4,7 +4,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
macauth_type = Puppet::Type.type(:macauthorization)
-describe Puppet.type(:macauthorization), "when checking macauthorization objects" do
+describe Puppet::Type.type(:macauthorization), "when checking macauthorization objects" do
before do
authplist = {}
diff --git a/spec/unit/type/user.rb b/spec/unit/type/user.rb
index caf932678..6e71ebbcc 100755
--- a/spec/unit/type/user.rb
+++ b/spec/unit/type/user.rb
@@ -239,11 +239,11 @@ describe user do
describe "when user has roles" do
it "should autorequire roles" do
#this is a little funky because the autorequire depends on a property with a feature
- testuser = Puppet.type(:user).create(:name => "testuser")
+ testuser = Puppet::Type.type(:user).create(:name => "testuser")
testuser.provider.class.expects(:feature?).with(:manages_solaris_rbac).returns(true)
testuser[:roles] = "testrole"
- testrole = Puppet.type(:user).create(:name => "testrole")
+ testrole = Puppet::Type.type(:user).create(:name => "testrole")
config = Puppet::Resource::Catalog.new :testing do |conf|
[testuser, testrole].each { |resource| conf.add_resource resource }
diff --git a/spec/unit/type/zfs.rb b/spec/unit/type/zfs.rb
index f36c715d2..56efa30de 100755
--- a/spec/unit/type/zfs.rb
+++ b/spec/unit/type/zfs.rb
@@ -25,14 +25,14 @@ describe zfs do
provider = mock "provider"
provider.stubs(:name).returns(:solaris)
zfs.stubs(:defaultprovider).returns(provider)
- Puppet.type(:zpool).stubs(:defaultprovider).returns(provider)
+ Puppet::Type.type(:zpool).stubs(:defaultprovider).returns(provider)
- foo_pool = Puppet.type(:zpool).create(:name => "foo")
+ foo_pool = Puppet::Type.type(:zpool).create(:name => "foo")
- foo_bar_zfs = Puppet.type(:zfs).create(:name => "foo/bar")
- foo_bar_baz_zfs = Puppet.type(:zfs).create(:name => "foo/bar/baz")
- foo_bar_baz_buz_zfs = Puppet.type(:zfs).create(:name => "foo/bar/baz/buz")
+ foo_bar_zfs = Puppet::Type.type(:zfs).create(:name => "foo/bar")
+ foo_bar_baz_zfs = Puppet::Type.type(:zfs).create(:name => "foo/bar/baz")
+ foo_bar_baz_buz_zfs = Puppet::Type.type(:zfs).create(:name => "foo/bar/baz/buz")
config = Puppet::Resource::Catalog.new :testing do |conf|
[foo_pool, foo_bar_zfs, foo_bar_baz_zfs, foo_bar_baz_buz_zfs].each { |resource| conf.add_resource resource }
diff --git a/spec/unit/util/storage.rb b/spec/unit/util/storage.rb
index b2c350267..04829598e 100755
--- a/spec/unit/util/storage.rb
+++ b/spec/unit/util/storage.rb
@@ -37,8 +37,8 @@ describe Puppet::Util::Storage do
describe "when caching a Puppet::Type" do
before(:all) do
- @file_test = Puppet.type(:file).create(:name => "/yayness", :check => %w{checksum type})
- @exec_test = Puppet.type(:exec).create(:name => "/bin/ls /yayness")
+ @file_test = Puppet::Type.type(:file).create(:name => "/yayness", :check => %w{checksum type})
+ @exec_test = Puppet::Type.type(:exec).create(:name => "/bin/ls /yayness")
end
it "should return an empty hash" do