summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2010-06-04 11:05:09 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitb5f14c6eeaaf8cc70287f3b1b2f74441157ac4b6 (patch)
treed7382c9aab6a99014cc28d512b8e8d04e551c566 /spec
parent2b5bd4927569c0a87ea32628cdc4303ff1e83853 (diff)
downloadpuppet-b5f14c6eeaaf8cc70287f3b1b2f74441157ac4b6.tar.gz
puppet-b5f14c6eeaaf8cc70287f3b1b2f74441157ac4b6.tar.xz
puppet-b5f14c6eeaaf8cc70287f3b1b2f74441157ac4b6.zip
{#3866] Rename the method metaclass to singleton_class to avoid the deprecation warnings from Rails ActiveSupport
The metaid.rb file came straight from why the lucky stiff's "seeing metaclasses clearly" article. Rails used this too, but they recently deprecated the name metaclass in favor of singleton_class to match what ruby-core decided to do. meta, eigen and singlton class were all suggested and in the end singleton was agreed upon. http://redmine.ruby-lang.org/issues/show/1082
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/file_serving/content.rb2
-rwxr-xr-xspec/unit/file_serving/metadata.rb2
-rwxr-xr-xspec/unit/indirector.rb2
-rwxr-xr-xspec/unit/indirector/indirection.rb2
-rwxr-xr-xspec/unit/indirector/yaml.rb2
-rwxr-xr-xspec/unit/relationship.rb2
-rwxr-xr-xspec/unit/resource.rb2
-rwxr-xr-xspec/unit/resource/catalog.rb2
-rwxr-xr-xspec/unit/ssl/certificate.rb2
-rwxr-xr-xspec/unit/ssl/certificate_request.rb2
-rwxr-xr-xspec/unit/ssl/key.rb2
-rwxr-xr-xspec/unit/util/cacher.rb4
-rwxr-xr-xspec/unit/util/tagging.rb2
13 files changed, 14 insertions, 14 deletions
diff --git a/spec/unit/file_serving/content.rb b/spec/unit/file_serving/content.rb
index cba703902..f772b861f 100755
--- a/spec/unit/file_serving/content.rb
+++ b/spec/unit/file_serving/content.rb
@@ -14,7 +14,7 @@ describe Puppet::FileServing::Content do
end
it "should should include the IndirectionHooks module in its indirection" do
- Puppet::FileServing::Content.indirection.metaclass.included_modules.should include(Puppet::FileServing::IndirectionHooks)
+ Puppet::FileServing::Content.indirection.singleton_class.included_modules.should include(Puppet::FileServing::IndirectionHooks)
end
it "should only support the raw format" do
diff --git a/spec/unit/file_serving/metadata.rb b/spec/unit/file_serving/metadata.rb
index 22f033d4d..ef2b3b6f0 100755
--- a/spec/unit/file_serving/metadata.rb
+++ b/spec/unit/file_serving/metadata.rb
@@ -14,7 +14,7 @@ describe Puppet::FileServing::Metadata do
end
it "should should include the IndirectionHooks module in its indirection" do
- Puppet::FileServing::Metadata.indirection.metaclass.included_modules.should include(Puppet::FileServing::IndirectionHooks)
+ Puppet::FileServing::Metadata.indirection.singleton_class.included_modules.should include(Puppet::FileServing::IndirectionHooks)
end
it "should have a method that triggers attribute collection" do
diff --git a/spec/unit/indirector.rb b/spec/unit/indirector.rb
index cb1b04932..806bcecbc 100755
--- a/spec/unit/indirector.rb
+++ b/spec/unit/indirector.rb
@@ -56,7 +56,7 @@ describe Puppet::Indirector, "when registering an indirection" do
it "should extend the class with the Format Handler" do
@indirection = @thingie.indirects :first
- @thingie.metaclass.ancestors.should be_include(Puppet::Network::FormatHandler)
+ @thingie.singleton_class.ancestors.should be_include(Puppet::Network::FormatHandler)
end
after do
diff --git a/spec/unit/indirector/indirection.rb b/spec/unit/indirector/indirection.rb
index 0f6fd13d5..8e62e1525 100755
--- a/spec/unit/indirector/indirection.rb
+++ b/spec/unit/indirector/indirection.rb
@@ -133,7 +133,7 @@ describe Puppet::Indirector::Indirection do
it "should extend itself with any specified module" do
mod = Module.new
@indirection = Puppet::Indirector::Indirection.new(mock('model'), :test, :extend => mod)
- @indirection.metaclass.included_modules.should include(mod)
+ @indirection.singleton_class.included_modules.should include(mod)
end
after do
diff --git a/spec/unit/indirector/yaml.rb b/spec/unit/indirector/yaml.rb
index d93199e1c..37c33f0cb 100755
--- a/spec/unit/indirector/yaml.rb
+++ b/spec/unit/indirector/yaml.rb
@@ -16,7 +16,7 @@ describe Puppet::Indirector::Yaml, " when choosing file location" do
@store = @store_class.new
@subject = Object.new
- @subject.metaclass.send(:attr_accessor, :name)
+ @subject.singleton_class.send(:attr_accessor, :name)
@subject.name = :me
@dir = "/what/ever"
diff --git a/spec/unit/relationship.rb b/spec/unit/relationship.rb
index 5a52cb587..b98e4e26e 100755
--- a/spec/unit/relationship.rb
+++ b/spec/unit/relationship.rb
@@ -213,7 +213,7 @@ describe Puppet::Relationship, "when converting from pson" do
end
it "should be extended with the PSON utility module" do
- Puppet::Relationship.metaclass.ancestors.should be_include(Puppet::Util::Pson)
+ Puppet::Relationship.singleton_class.ancestors.should be_include(Puppet::Util::Pson)
end
# LAK:NOTE For all of these tests, we convert back to the edge so we can
diff --git a/spec/unit/resource.rb b/spec/unit/resource.rb
index a2b214dae..0e34c3cbc 100755
--- a/spec/unit/resource.rb
+++ b/spec/unit/resource.rb
@@ -615,7 +615,7 @@ describe Puppet::Resource do
end
it "should include the pson util module" do
- Puppet::Resource.metaclass.ancestors.should be_include(Puppet::Util::Pson)
+ Puppet::Resource.singleton_class.ancestors.should be_include(Puppet::Util::Pson)
end
# LAK:NOTE For all of these tests, we convert back to the resource so we can
diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/catalog.rb
index 6c6a5e15e..26f69aedf 100755
--- a/spec/unit/resource/catalog.rb
+++ b/spec/unit/resource/catalog.rb
@@ -950,7 +950,7 @@ describe Puppet::Resource::Catalog, "when converting from pson" do
end
it "should be extended with the PSON utility module" do
- Puppet::Resource::Catalog.metaclass.ancestors.should be_include(Puppet::Util::Pson)
+ Puppet::Resource::Catalog.singleton_class.ancestors.should be_include(Puppet::Util::Pson)
end
it "should create it with the provided name" do
diff --git a/spec/unit/ssl/certificate.rb b/spec/unit/ssl/certificate.rb
index 0d48991ad..6bd7e77f5 100755
--- a/spec/unit/ssl/certificate.rb
+++ b/spec/unit/ssl/certificate.rb
@@ -14,7 +14,7 @@ describe Puppet::SSL::Certificate do
end
it "should be extended with the Indirector module" do
- @class.metaclass.should be_include(Puppet::Indirector)
+ @class.singleton_class.should be_include(Puppet::Indirector)
end
it "should indirect certificate" do
diff --git a/spec/unit/ssl/certificate_request.rb b/spec/unit/ssl/certificate_request.rb
index 63bc9f110..253009b5d 100755
--- a/spec/unit/ssl/certificate_request.rb
+++ b/spec/unit/ssl/certificate_request.rb
@@ -11,7 +11,7 @@ describe Puppet::SSL::CertificateRequest do
end
it "should be extended with the Indirector module" do
- @class.metaclass.should be_include(Puppet::Indirector)
+ @class.singleton_class.should be_include(Puppet::Indirector)
end
it "should indirect certificate_request" do
diff --git a/spec/unit/ssl/key.rb b/spec/unit/ssl/key.rb
index b23470451..cfeaf7906 100755
--- a/spec/unit/ssl/key.rb
+++ b/spec/unit/ssl/key.rb
@@ -10,7 +10,7 @@ describe Puppet::SSL::Key do
end
it "should be extended with the Indirector module" do
- @class.metaclass.should be_include(Puppet::Indirector)
+ @class.singleton_class.should be_include(Puppet::Indirector)
end
it "should indirect key" do
diff --git a/spec/unit/util/cacher.rb b/spec/unit/util/cacher.rb
index 40688bc88..eb8515e4d 100755
--- a/spec/unit/util/cacher.rb
+++ b/spec/unit/util/cacher.rb
@@ -40,7 +40,7 @@ end
describe Puppet::Util::Cacher do
it "should be extended with the Expirer module" do
- Puppet::Util::Cacher.metaclass.ancestors.should be_include(Puppet::Util::Cacher::Expirer)
+ Puppet::Util::Cacher.singleton_class.ancestors.should be_include(Puppet::Util::Cacher::Expirer)
end
it "should support defining cached attributes" do
@@ -154,7 +154,7 @@ describe Puppet::Util::Cacher do
extend Puppet::Util::Cacher
end
- klass.metaclass.cached_attr(:myattr) { "eh" }
+ klass.singleton_class.cached_attr(:myattr) { "eh" }
klass.myattr
end
diff --git a/spec/unit/util/tagging.rb b/spec/unit/util/tagging.rb
index 3486f46f2..04800b378 100755
--- a/spec/unit/util/tagging.rb
+++ b/spec/unit/util/tagging.rb
@@ -66,7 +66,7 @@ describe Puppet::Util::Tagging, "when adding tags" do
end
it "should provide a method for testing tag validity" do
- @tagger.metaclass.publicize_methods(:valid_tag?) { @tagger.should be_respond_to(:valid_tag?) }
+ @tagger.singleton_class.publicize_methods(:valid_tag?) { @tagger.should be_respond_to(:valid_tag?) }
end
it "should add qualified classes as tags" do