summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/parser')
-rwxr-xr-xspec/integration/parser/compiler.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/integration/parser/compiler.rb b/spec/integration/parser/compiler.rb
new file mode 100755
index 000000000..27666400b
--- /dev/null
+++ b/spec/integration/parser/compiler.rb
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe Puppet::Parser::Compiler do
+ before :each do
+ @node = Puppet::Node.new "testnode"
+
+ @scope_resource = stub 'scope_resource', :builtin? => true, :finish => nil, :ref => 'Class[main]'
+ @scope = stub 'scope', :resource => @scope_resource, :source => mock("source")
+ end
+
+ after do
+ Puppet.settings.clear
+ end
+
+ it "should be able to determine the configuration version from a local version control repository" do
+ # This should always work, because we should always be
+ # in the puppet repo when we run this.
+ version = %x{git rev-parse HEAD}.chomp
+
+ Puppet.settings[:config_version] = 'git rev-parse HEAD'
+
+ @parser = Puppet::Parser::Parser.new :environment => "development"
+ @compiler = Puppet::Parser::Compiler.new(@node, @parser)
+
+ @compiler.catalog.version.should == version
+ end
+end