diff options
| author | Luke Kanies <luke@madstop.com> | 2008-12-11 08:24:43 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-12-18 11:10:22 -0600 |
| commit | 60062e4b9ae479ddbf97f4fc3495d04bc00196d5 (patch) | |
| tree | 4eee797b0c2f883c1daeb383a07ca87749cd7d11 /spec | |
| parent | 6b14000ae54a11da3fa16c1b4685f630abca869b (diff) | |
Renaming the "Catalog#to_type" method to "Catalog#to_ral"
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/other/transbucket.rb | 10 | ||||
| -rwxr-xr-x | spec/unit/other/transobject.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/parser/resource.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/resource/catalog.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/type.rb | 3 |
5 files changed, 13 insertions, 10 deletions
diff --git a/spec/unit/other/transbucket.rb b/spec/unit/other/transbucket.rb index 60efcdb87..3445e26b0 100755 --- a/spec/unit/other/transbucket.rb +++ b/spec/unit/other/transbucket.rb @@ -12,7 +12,7 @@ describe Puppet::TransBucket do @bucket.type = "user" resource = nil - proc { resource = @bucket.to_type }.should_not raise_error + proc { resource = @bucket.to_ral }.should_not raise_error resource.should be_instance_of(Puppet::Type::Component) resource.title.should == "User[luke]" end @@ -99,7 +99,7 @@ describe Puppet::TransBucket, " when generating a catalog" do end it "should fail if any transportable resources fail to convert to RAL resources" do - @bottomobj.expects(:to_type).raises ArgumentError + @bottomobj.expects(:to_ral).raises ArgumentError lambda { @bottom.to_catalog }.should raise_error(ArgumentError) end @@ -120,12 +120,12 @@ describe Puppet::TransBucket, " when generating a catalog" do @catalog.vertices.each do |vertex| vertex.should be_finalized end end - it "should only call to_type on each resource once" do + it "should only call to_ral on each resource once" do # We just raise exceptions here because we're not interested in # what happens with the result, only that the method only # gets called once. - resource = @topobj.to_type - @topobj.expects(:to_type).once.returns resource + resource = @topobj.to_ral + @topobj.expects(:to_ral).once.returns resource @top.to_catalog end diff --git a/spec/unit/other/transobject.rb b/spec/unit/other/transobject.rb index 33de72c74..7546cf686 100755 --- a/spec/unit/other/transobject.rb +++ b/spec/unit/other/transobject.rb @@ -50,13 +50,13 @@ describe Puppet::TransObject, " when converting to a RAL resource" do type = mock 'resource type' type.expects(:create).with(@resource).returns(:myresource) Puppet::Type.expects(:type).with("file").returns(type) - @resource.to_type.should == :myresource + @resource.to_ral.should == :myresource end it "should convert to a component instance if the resource type cannot be found" do Puppet::Type.expects(:type).with("file").returns(nil) @resource.expects(:to_component).returns(:mycomponent) - @resource.to_type.should == :mycomponent + @resource.to_ral.should == :mycomponent end end diff --git a/spec/unit/parser/resource.rb b/spec/unit/parser/resource.rb index 5ae8a644a..e778dc8e4 100755 --- a/spec/unit/parser/resource.rb +++ b/spec/unit/parser/resource.rb @@ -65,10 +65,10 @@ describe Puppet::Parser::Resource do end it "should use a Puppet::Resource for converting to a ral resource" do - trans = mock 'resource', :to_type => "yay" + trans = mock 'resource', :to_ral => "yay" @resource = mkresource @resource.expects(:to_resource).returns trans - @resource.to_type.should == "yay" + @resource.to_ral.should == "yay" end describe "when initializing" do diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/catalog.rb index 44ad25aac..53cb98fef 100755 --- a/spec/unit/resource/catalog.rb +++ b/spec/unit/resource/catalog.rb @@ -325,7 +325,7 @@ describe Puppet::Resource::Catalog, "when compiling" do #changer is going to get duplicated as part of a fix for aliases 1094 changer.expects(:dup).returns(changer) - changer.expects(:to_type).returns(resource) + changer.expects(:to_ral).returns(resource) newconfig = nil diff --git a/spec/unit/type.rb b/spec/unit/type.rb index a279e1139..b8950297a 100755 --- a/spec/unit/type.rb +++ b/spec/unit/type.rb @@ -34,6 +34,9 @@ describe Puppet::Type do resource.parameter(:fstype).must be_instance_of(Puppet::Type.type(:mount).attrclass(:fstype)) end + describe "when initializing" do + end + describe "when retrieving current property values" do # Use 'mount' as an example, because it doesn't override 'retrieve' before do |
