summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-09-19 21:21:33 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-09-22 09:27:22 +1000
commitd53bc169861815ce7cffac431f76304c995bb4fa (patch)
treee87c0b2ff373a68cbc61115e8327af41edf10dde /spec
parent5f2558939bbf4ce180aa5d7c0d534e974bd01a4f (diff)
downloadpuppet-d53bc169861815ce7cffac431f76304c995bb4fa.tar.gz
puppet-d53bc169861815ce7cffac431f76304c995bb4fa.tar.xz
puppet-d53bc169861815ce7cffac431f76304c995bb4fa.zip
Adding version information to the catalog for compat
We need to be able to do compatibility testing, and this allows us to do so. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/parser/compiler.rb9
-rwxr-xr-xspec/unit/resource/catalog.rb12
2 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/parser/compiler.rb b/spec/unit/parser/compiler.rb
index ad6f351bf..41f03f2ac 100755
--- a/spec/unit/parser/compiler.rb
+++ b/spec/unit/parser/compiler.rb
@@ -131,6 +131,15 @@ describe Puppet::Parser::Compiler do
@compiler.topscope.lookupvar("c").should == "d"
end
+ it "should set the client and server versions on the catalog" do
+ params = {"clientversion" => "2", "serverversion" => "3"}
+ @node.stubs(:parameters).returns(params)
+ compile_stub(:set_node_parameters)
+ @compiler.compile
+ @compiler.catalog.client_version.should == "2"
+ @compiler.catalog.server_version.should == "3"
+ end
+
it "should evaluate any existing classes named in the node" do
classes = %w{one two three four}
main = stub 'main'
diff --git a/spec/unit/resource/catalog.rb b/spec/unit/resource/catalog.rb
index af399aa0f..1fbe3a984 100755
--- a/spec/unit/resource/catalog.rb
+++ b/spec/unit/resource/catalog.rb
@@ -35,6 +35,18 @@ describe Puppet::Resource::Catalog, "when compiling" do
@catalog.write_class_file
end
+ it "should have a client_version attribute" do
+ @catalog = Puppet::Resource::Catalog.new("host")
+ @catalog.client_version = 5
+ @catalog.client_version.should == 5
+ end
+
+ it "should have a server_version attribute" do
+ @catalog = Puppet::Resource::Catalog.new("host")
+ @catalog.server_version = 5
+ @catalog.server_version.should == 5
+ end
+
describe "when compiling" do
it "should accept tags" do
config = Puppet::Resource::Catalog.new("mynode")