diff options
| author | Markus Roberts <Markus@reality.com> | 2010-06-23 15:51:08 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-06-23 22:27:29 -0700 |
| commit | 51b70c05167399eb2274fc1add18b6b18d31429d (patch) | |
| tree | 1a33b11f0f589d6f5cd806d6da9de317887ca0e6 /spec/unit/parser/functions/template.rb | |
| parent | 9958c805dd90acadbb56ed3095e665d8afa990cd (diff) | |
| download | puppet-51b70c05167399eb2274fc1add18b6b18d31429d.tar.gz puppet-51b70c05167399eb2274fc1add18b6b18d31429d.tar.xz puppet-51b70c05167399eb2274fc1add18b6b18d31429d.zip | |
[#3994] rename the specs to have _spec.rb at the end
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
Diffstat (limited to 'spec/unit/parser/functions/template.rb')
| -rwxr-xr-x | spec/unit/parser/functions/template.rb | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/spec/unit/parser/functions/template.rb b/spec/unit/parser/functions/template.rb deleted file mode 100755 index 8fc64d0c3..000000000 --- a/spec/unit/parser/functions/template.rb +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env ruby - -require File.dirname(__FILE__) + '/../../../spec_helper' - -describe "the template function" do - - before :each do - @scope = Puppet::Parser::Scope.new() - end - - it "should exist" do - Puppet::Parser::Functions.function("template").should == "function_template" - end - - it "should create a TemplateWrapper when called" do - tw = stub_everything 'template_wrapper' - - Puppet::Parser::TemplateWrapper.expects(:new).returns(tw) - - @scope.function_template("test") - end - - it "should give the template filename to the TemplateWrapper" do - tw = stub_everything 'template_wrapper' - Puppet::Parser::TemplateWrapper.stubs(:new).returns(tw) - - tw.expects(:file=).with("test") - - @scope.function_template("test") - end - - it "should return what TemplateWrapper.result returns" do - tw = stub_everything 'template_wrapper' - Puppet::Parser::TemplateWrapper.stubs(:new).returns(tw) - tw.stubs(:file=).with("test") - - tw.expects(:result).returns("template contents evaluated") - - @scope.function_template("test").should == "template contents evaluated" - end - - it "should concatenate template wrapper outputs for multiple templates" do - tw1 = stub_everything "template_wrapper1" - tw2 = stub_everything "template_wrapper2" - Puppet::Parser::TemplateWrapper.stubs(:new).returns(tw1,tw2) - tw1.stubs(:file=).with("1") - tw2.stubs(:file=).with("2") - tw1.stubs(:result).returns("result1") - tw2.stubs(:result).returns("result2") - - @scope.function_template(["1","2"]).should == "result1result2" - end - - it "should raise an error if the template raises an error" do - tw = stub_everything 'template_wrapper' - Puppet::Parser::TemplateWrapper.stubs(:new).returns(tw) - tw.stubs(:result).raises - - lambda { @scope.function_template("1") }.should raise_error(Puppet::ParseError) - end - -end
\ No newline at end of file |
