Sha256: 98c2928b05227afc9b1ece627c33fdad285731b4f2dc268828f34fa764d44f51

Contents?: true

Size: 790 Bytes

Versions: 8

Compression:

Stored size: 790 Bytes

Contents

#!/usr/bin/env ruby
#
#  Created by Luke A. Kanies on 2007-0419.
#  Copyright (c) 2006. All rights reserved.

require File.dirname(__FILE__) + '/../../lib/puppettest'

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), "did not return empty string on unset var")
        @scope.setvar(@name, "something")
        assert_equal("something", @var.evaluate(@scope), "incorrect variable value")
    end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puppet-0.24.9 test/language/ast/variable.rb
puppet-0.24.3 test/language/ast/variable.rb
puppet-0.24.2 test/language/ast/variable.rb
puppet-0.24.4 test/language/ast/variable.rb
puppet-0.24.7 test/language/ast/variable.rb
puppet-0.24.6 test/language/ast/variable.rb
puppet-0.24.5 test/language/ast/variable.rb
puppet-0.24.8 test/language/ast/variable.rb