summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMax Martin <max@puppetlabs.com>2011-03-15 15:57:27 -0700
committerMax Martin <max@puppetlabs.com>2011-03-15 15:57:27 -0700
commit9016662cc108dbcced5ad9c9a33f4ecd61cac178 (patch)
tree221f791ff7516cb15e7254ca20e3f38dcf9f175a /spec
parentc0712d367583c5a1a6c68cd469a5e42a90685f56 (diff)
parenta6d0e99e97d18b622793a807e985580cb65a8c7c (diff)
downloadpuppet-9016662cc108dbcced5ad9c9a33f4ecd61cac178.tar.gz
puppet-9016662cc108dbcced5ad9c9a33f4ecd61cac178.tar.xz
puppet-9016662cc108dbcced5ad9c9a33f4ecd61cac178.zip
Merge branch '2.6.next' of github.com:puppetlabs/puppet into 2.6.next
* '2.6.next' of github.com:puppetlabs/puppet: (#6689) Remove extraneous include of Puppet::Util in InventoryActiveRecord Remove extra trailing whitespace from lib/puppet/resource.rb (#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs (#6707) Fix typo in rest_authconfig.rb (#6689) Make inventory_active_record terminus search quickly (#5662) Fixed tests that didnt stub key_attributes (#5662) Parsedfile doesnt work with mult keyattr (#5661) Creating types dont work with >1 namevar
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/indirector/facts/inventory_active_record_spec.rb3
-rwxr-xr-xspec/unit/provider/ssh_authorized_key/parsed_spec.rb1
-rwxr-xr-xspec/unit/resource_spec.rb22
3 files changed, 23 insertions, 3 deletions
diff --git a/spec/unit/indirector/facts/inventory_active_record_spec.rb b/spec/unit/indirector/facts/inventory_active_record_spec.rb
index c29e58400..9558abde2 100644
--- a/spec/unit/indirector/facts/inventory_active_record_spec.rb
+++ b/spec/unit/indirector/facts/inventory_active_record_spec.rb
@@ -68,9 +68,6 @@ describe "Puppet::Node::Facts::InventoryActiveRecord", :if => (Puppet.features.r
Puppet::Node::Facts.find("foo").should == foo_facts
Puppet::Rails::InventoryFact.all.map{|f| [f.name,f.value]}.should_not include(["uptime_days", "30"], ["kernel", "Darwin"])
end
-
- it "should not replace the node's facts if something goes wrong" do
- end
end
describe "#find" do
diff --git a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
index 11e9233e0..2e5be165a 100755
--- a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
+++ b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
@@ -104,6 +104,7 @@ describe provider_class do
before :each do
@resource = stub("resource", :name => "foo")
@resource.stubs(:[]).returns "foo"
+ @resource.class.stubs(:key_attributes).returns( [:name] )
@provider = provider_class.new(@resource)
provider_class.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam)
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index eaa3d5519..345ccd06e 100755
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -463,6 +463,28 @@ describe Puppet::Resource do
end
end
+ describe "when loading 0.25.x storedconfigs YAML" do
+ before :each do
+ @old_storedconfig_yaml = %q{--- !ruby/object:Puppet::Resource::Reference
+builtin_type:
+title: /tmp/bar
+type: File
+}
+ end
+
+ it "should deserialize a Puppet::Resource::Reference without exceptions" do
+ lambda { YAML.load(@old_storedconfig_yaml) }.should_not raise_error
+ end
+
+ it "should deserialize as a Puppet::Resource::Reference as a Puppet::Resource" do
+ YAML.load(@old_storedconfig_yaml).class.should == Puppet::Resource
+ end
+
+ it "should to_hash properly" do
+ YAML.load(@old_storedconfig_yaml).to_hash.should == { :path => "/tmp/bar" }
+ end
+ end
+
describe "when converting to a RAL resource" do
it "should use the resource type's :new method to create the resource if the resource is of a builtin type" do
resource = Puppet::Resource.new("file", @basepath+"/my/file")