summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser/ast/resource_defaults_spec.rb
blob: 7402be8eaa855a79c08bb0f76074804fbbd9c582 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env ruby

require 'spec_helper'

describe Puppet::Parser::AST::ResourceDefaults do

  ast = Puppet::Parser::AST

  before :each do
    @compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("mynode"))
    @scope = Puppet::Parser::Scope.new(:compiler => @compiler)
    @params = Puppet::Parser::AST::ASTArray.new({})
    @compiler.stubs(:add_override)
  end

  it "should add defaults when evaluated" do
    default = Puppet::Parser::AST::ResourceDefaults.new :type => "file", :parameters => Puppet::Parser::AST::ASTArray.new(:children => [])
    default.evaluate @scope

    @scope.lookupdefaults("file").should_not be_nil
  end
end