summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-12-11 08:24:43 -0600
committerLuke Kanies <luke@madstop.com>2008-12-18 11:10:22 -0600
commit60062e4b9ae479ddbf97f4fc3495d04bc00196d5 (patch)
tree4eee797b0c2f883c1daeb383a07ca87749cd7d11 /test
parent6b14000ae54a11da3fa16c1b4685f630abca869b (diff)
downloadpuppet-60062e4b9ae479ddbf97f4fc3495d04bc00196d5.tar.gz
puppet-60062e4b9ae479ddbf97f4fc3495d04bc00196d5.tar.xz
puppet-60062e4b9ae479ddbf97f4fc3495d04bc00196d5.zip
Renaming the "Catalog#to_type" method to "Catalog#to_ral"
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'test')
-rw-r--r--test/lib/puppettest/support/utils.rb2
-rwxr-xr-xtest/network/client/resource.rb4
-rwxr-xr-xtest/network/handler/resource.rb6
-rwxr-xr-xtest/ral/manager/type.rb71
-rwxr-xr-xtest/util/settings.rb2
5 files changed, 8 insertions, 77 deletions
diff --git a/test/lib/puppettest/support/utils.rb b/test/lib/puppettest/support/utils.rb
index aa3ad8b8d..c00d8a132 100644
--- a/test/lib/puppettest/support/utils.rb
+++ b/test/lib/puppettest/support/utils.rb
@@ -17,7 +17,7 @@ module PuppetTest::Support::Utils
transport[:path] = path
transport[:ensure] = "file"
assert_nothing_raised {
- file = transport.to_type
+ file = transport.to_ral
}
end
diff --git a/test/network/client/resource.rb b/test/network/client/resource.rb
index 6a2e52471..86c6ccd2f 100755
--- a/test/network/client/resource.rb
+++ b/test/network/client/resource.rb
@@ -40,7 +40,7 @@ class TestResourceClient < Test::Unit::TestCase
resource = nil
assert_nothing_raised {
- resource = tresource.to_type
+ resource = tresource.to_ral
}
assert_events([], resource)
p resource.instance_variable_get("@stat")
@@ -75,7 +75,7 @@ class TestResourceClient < Test::Unit::TestCase
resource = nil
assert_nothing_raised {
- resource = tresource2.to_type
+ resource = tresource2.to_ral
}
assert_events([], resource)
diff --git a/test/network/handler/resource.rb b/test/network/handler/resource.rb
index 269c9571c..d766c685d 100755
--- a/test/network/handler/resource.rb
+++ b/test/network/handler/resource.rb
@@ -15,7 +15,7 @@ class TestResourceServer < Test::Unit::TestCase
described.each do |name, trans|
obj = nil
assert_nothing_raised do
- obj = trans.to_type
+ obj = trans.to_ral
end
assert(obj, "Could not create object")
@@ -61,7 +61,7 @@ class TestResourceServer < Test::Unit::TestCase
object = nil
assert_nothing_raised do
- object = result.to_type
+ object = result.to_ral
end
assert(object, "Could not create type")
@@ -110,7 +110,7 @@ class TestResourceServer < Test::Unit::TestCase
object = nil
assert_nothing_raised do
- object = result.to_type
+ object = result.to_ral
end
catalog = mk_catalog(object)
diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb
index f3a116f6f..a56e81267 100755
--- a/test/ral/manager/type.rb
+++ b/test/ral/manager/type.rb
@@ -140,7 +140,7 @@ class TestType < Test::Unit::TestCase
def test_catalogs_are_set_during_initialization_if_present_on_the_transobject
trans = Puppet::TransObject.new("/path/to/some/file", :file)
trans.catalog = stub 'catalog', :resource => nil
- resource = trans.to_type
+ resource = trans.to_ral
assert_equal(resource.catalog, trans.catalog, "Did not set catalog on initialization")
end
@@ -375,75 +375,6 @@ class TestType < Test::Unit::TestCase
assert_equal(path, file[:name], "Did not get correct name")
end
- # Make sure the "create" class method behaves appropriately.
- def test_class_create
- title = "Myfile"
- validate = proc do |element|
- assert(element, "Did not create file")
- assert_instance_of(Puppet::Type.type(:file), element)
- assert_equal(title, element.title, "Title is not correct")
- end
- type = :file
- args = {:path => tempfile(), :owner => "root"}
-
- trans = Puppet::TransObject.new(title, type)
- args.each do |name, val| trans[name] = val end
-
- # First call it on the appropriate typeclass
- obj = nil
- assert_nothing_raised do
- obj = Puppet::Type.type(:file).create(trans)
- end
-
- validate.call(obj)
-
- # Now try it using the class method on Type
- oldid = obj.object_id
- obj = nil
-
- assert_nothing_raised {
- obj = Puppet::Type.create(trans)
- }
-
- validate.call(obj)
- assert(oldid != obj.object_id, "Got same object back")
-
- # Now try the same things with hashes instead of a transobject
- oldid = obj.object_id
- obj = nil
- hash = {
- :type => :file,
- :title => "Myfile",
- :path => tempfile(),
- :owner => "root"
- }
-
- # First call it on the appropriate typeclass
- obj = nil
- assert_nothing_raised do
- obj = Puppet::Type.type(:file).create(hash)
- end
-
- validate.call(obj)
- assert_equal(:file, obj.should(:type),
- "Type param did not pass through")
-
- assert(oldid != obj.object_id, "Got same object back")
-
- # Now try it using the class method on Type
- oldid = obj.object_id
- obj = nil
-
- assert_nothing_raised {
- obj = Puppet::Type.create(hash)
- }
-
- validate.call(obj)
- assert(oldid != obj.object_id, "Got same object back")
- assert_nil(obj.should(:type),
- "Type param passed through")
- end
-
def test_multiplenames
obj = nil
path = tempfile()
diff --git a/test/util/settings.rb b/test/util/settings.rb
index 94b01c80e..049c005b9 100755
--- a/test/util/settings.rb
+++ b/test/util/settings.rb
@@ -51,7 +51,7 @@ class TestSettings < Test::Unit::TestCase
comp = nil
assert_nothing_raised("Could not convert transportable to component") {
- comp = trans.to_type
+ comp = trans.to_ral
}
assert_nothing_raised("Could not retrieve transported config") {