blob: bf22021d036ddeed32352c3cfc36d6569b9657dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/usr/bin/env ruby
#
# Created by Luke A. Kanies on 2007-0419.
# Copyright (c) 2006. All rights reserved.
$:.unshift("../lib").unshift("../../lib") if __FILE__ =~ /\.rb$/
require 'puppettest'
require 'puppettest/parsertesting'
class TestVariable < Test::Unit::TestCase
include PuppetTest
include PuppetTest::ParserTesting
AST = Puppet::Parser::AST
def setup
super
@interp = mkinterp
@scope = mkscope :interp => @interp
@name = "myvar"
@var = AST::Variable.new(:value => @name)
end
def test_evaluate
assert_equal("", @var.evaluate(:scope => @scope), "did not return empty string on unset var")
@scope.setvar(@name, "something")
assert_equal("something", @var.evaluate(:scope => @scope), "incorrect variable value")
end
end
|