summaryrefslogtreecommitdiffstats
path: root/test/language
diff options
context:
space:
mode:
authorIan Taylor <ian@lorf.org>2009-06-05 12:39:04 -0400
committerJames Turnbull <james@lovedthanlost.net>2009-06-06 09:12:00 +1000
commit4f2c066a97e59a89df64af4b25beac6f3f0553c2 (patch)
tree126540beec3c65448e01e1b48d27275ec4ee6ea4 /test/language
parent97e6975d69f239e24993315a25a3117b1daa48c3 (diff)
downloadpuppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.tar.gz
puppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.tar.xz
puppet-4f2c066a97e59a89df64af4b25beac6f3f0553c2.zip
Removed extra whitespace from end of lines
Diffstat (limited to 'test/language')
-rwxr-xr-xtest/language/ast/resource_reference.rb2
-rwxr-xr-xtest/language/ast/selector.rb16
-rwxr-xr-xtest/language/ast/variable.rb2
-rwxr-xr-xtest/language/functions.rb24
-rwxr-xr-xtest/language/parser.rb22
-rwxr-xr-xtest/language/scope.rb4
-rwxr-xr-xtest/language/snippets.rb8
7 files changed, 39 insertions, 39 deletions
diff --git a/test/language/ast/resource_reference.rb b/test/language/ast/resource_reference.rb
index 44c23fd2b..47b49d1e0 100755
--- a/test/language/ast/resource_reference.rb
+++ b/test/language/ast/resource_reference.rb
@@ -12,7 +12,7 @@ class TestASTResourceReference < Test::Unit::TestCase
include PuppetTest
include PuppetTest::ParserTesting
AST = Puppet::Parser::AST
-
+
def newref(type, title)
AST::ResourceReference.new(:type => type, :title => AST::String.new(:value => title))
end
diff --git a/test/language/ast/selector.rb b/test/language/ast/selector.rb
index 0c9a6e675..d2b1622d2 100755
--- a/test/language/ast/selector.rb
+++ b/test/language/ast/selector.rb
@@ -12,26 +12,26 @@ class TestSelector < Test::Unit::TestCase
include PuppetTest
include PuppetTest::ParserTesting
AST = Puppet::Parser::AST
-
+
def test_evaluate
scope = mkscope
upperparam = nameobj("MYPARAM")
lowerparam = nameobj("myparam")
-
+
should = {"MYPARAM" => "upper", "myparam" => "lower"}
-
+
maker = Proc.new do
{
:default => AST::ResourceParam.new(:param => AST::Default.new(:value => "default"), :value => FakeAST.new("default")),
:lower => AST::ResourceParam.new(:param => FakeAST.new("myparam"), :value => FakeAST.new("lower")),
:upper => AST::ResourceParam.new(:param => FakeAST.new("MYPARAM"), :value => FakeAST.new("upper")),
}
-
+
end
-
+
# Start out case-sensitive
Puppet[:casesensitive] = true
-
+
%w{MYPARAM myparam}.each do |str|
param = nameobj(str)
params = maker.call()
@@ -40,10 +40,10 @@ class TestSelector < Test::Unit::TestCase
assert_nothing_raised { result = sel.evaluate(scope) }
assert_equal(should[str], result, "did not case-sensitively match %s" % str)
end
-
+
# then insensitive
Puppet[:casesensitive] = false
-
+
%w{MYPARAM myparam}.each do |str|
param = nameobj(str)
params = maker.call()
diff --git a/test/language/ast/variable.rb b/test/language/ast/variable.rb
index 7aef2a8c2..17e078b32 100755
--- a/test/language/ast/variable.rb
+++ b/test/language/ast/variable.rb
@@ -12,7 +12,7 @@ class TestVariable < Test::Unit::TestCase
include PuppetTest
include PuppetTest::ParserTesting
AST = Puppet::Parser::AST
-
+
def setup
super
@interp = mkinterp
diff --git a/test/language/functions.rb b/test/language/functions.rb
index 7e153ec3d..030928618 100755
--- a/test/language/functions.rb
+++ b/test/language/functions.rb
@@ -388,17 +388,17 @@ class TestLangFunctions < Test::Unit::TestCase
def test_realize
scope = mkscope
parser = scope.compiler.parser
-
+
realize = Puppet::Parser::Functions.function(:realize)
# Make a definition
parser.newdefine("mytype")
-
+
[%w{file /tmp/virtual}, %w{mytype yay}].each do |type, title|
# Make a virtual resource
virtual = mkresource(:type => type, :title => title,
:virtual => true, :params => {}, :scope => scope)
-
+
scope.compiler.add_resource(scope, virtual)
ref = Puppet::Parser::Resource::Reference.new(
@@ -442,39 +442,39 @@ class TestLangFunctions < Test::Unit::TestCase
assert_equal([none.to_s], scope.compiler.collections[0].resources,
"Did not set resources in collection")
end
-
+
def test_defined
scope = mkscope
parser = scope.compiler.parser
defined = Puppet::Parser::Functions.function(:defined)
-
+
parser.newclass("yayness")
parser.newdefine("rahness")
-
+
assert_nothing_raised do
assert(scope.function_defined("yayness"), "yayness class was not considered defined")
assert(scope.function_defined("rahness"), "rahness definition was not considered defined")
assert(scope.function_defined("service"), "service type was not considered defined")
assert(! scope.function_defined("fakness"), "fakeness was considered defined")
end
-
+
# Now make sure any match in a list will work
assert(scope.function_defined(["booness", "yayness", "fakeness"]),
"A single answer was not sufficient to return true")
-
+
# and make sure multiple falses are still false
assert(! scope.function_defined(%w{no otherno stillno}),
"Multiple falses were somehow true")
-
+
# Now make sure we can test resources
scope.compiler.add_resource(scope, mkresource(:type => "file", :title => "/tmp/rahness",
:scope => scope, :source => scope.source,
:params => {:owner => "root"}))
-
+
yep = Puppet::Parser::Resource::Reference.new(:type => "file", :title => "/tmp/rahness")
nope = Puppet::Parser::Resource::Reference.new(:type => "file", :title => "/tmp/fooness")
-
+
assert(scope.function_defined([yep]), "valid resource was not considered defined")
assert(! scope.function_defined([nope]), "invalid resource was considered defined")
end
@@ -482,7 +482,7 @@ class TestLangFunctions < Test::Unit::TestCase
def test_search
parser = mkparser
scope = mkscope(:parser => parser)
-
+
fun = parser.newdefine("yay::ness")
foo = parser.newdefine("foo::bar")
diff --git a/test/language/parser.rb b/test/language/parser.rb
index 01b18acd9..acb20c985 100755
--- a/test/language/parser.rb
+++ b/test/language/parser.rb
@@ -308,7 +308,7 @@ class TestParser < Test::Unit::TestCase
f.puts %{
node nodeA, nodeB {
file { "#{other}": ensure => file }
-
+
}
}
end
@@ -403,7 +403,7 @@ file { "/tmp/yayness":
}
sub = parser.classes["container::deep::sub"]
assert(sub, "Could not find sub")
-
+
# Now try it with a parent class being a fq class
assert_nothing_raised {
parser.parse "class container::one inherits container::deep::sub {}"
@@ -411,7 +411,7 @@ file { "/tmp/yayness":
sub = parser.classes["container::one"]
assert(sub, "Could not find one")
assert_equal("container::deep::sub", sub.parentclass)
-
+
# Finally, try including a qualified class
assert_nothing_raised("Could not include fully qualified class") {
parser.parse "include container::deep::sub"
@@ -635,7 +635,7 @@ file { "/tmp/yayness":
assert(code.length == 1, "Did not get the file")
assert_instance_of(Puppet::TransObject, code[0])
end
-
+
def test_fully_qualified_definitions
parser = mkparser
@@ -643,7 +643,7 @@ file { "/tmp/yayness":
parser.parse %{define one::two { }}
}
assert(parser.definitions["one::two"], "Could not find one::two with no namespace")
-
+
# Now try using the definition
assert_nothing_raised("Could not parse fully-qualified definition usage") {
parser.parse %{one::two { yayness: }}
@@ -792,7 +792,7 @@ file { "/tmp/yayness":
def test_parse
parser = mkparser
- str = "file { '/tmp/yay': ensure => file }\nclass yay {}\nnode foo {}\ndefine bar {}\n"
+ str = "file { '/tmp/yay': ensure => file }\nclass yay {}\nnode foo {}\ndefine bar {}\n"
result = nil
assert_nothing_raised("Could not parse") do
result = parser.parse(str)
@@ -1004,7 +1004,7 @@ file { "/tmp/yayness":
end
end
end
-
+
# Now make sure we get appropriate behaviour with parent class conflicts.
def test_newclass_parentage
parser = mkparser
@@ -1199,17 +1199,17 @@ file { "/tmp/yayness":
assert_instance_of(AST::Definition, klass, "Did not autoload definition from its own file")
assert_equal("mymod::mydefine", klass.classname, "Incorrect definition was returned")
end
-
+
# Make sure class, node, and define methods are case-insensitive
def test_structure_case_insensitivity
parser = mkparser
-
+
result = nil
assert_nothing_raised do
result = parser.newclass "Yayness"
end
assert_equal(result, parser.findclass("", "yayNess"))
-
+
assert_nothing_raised do
result = parser.newdefine "FunTest"
end
@@ -1225,7 +1225,7 @@ file { "/tmp/yayness":
Puppet::Parser::Files.expects(:find_manifests).with("test", {:cwd => ".", :environment => "something"}).returns([])
assert_raise(Puppet::ImportError) do
- parser.import("test")
+ parser.import("test")
end
end
diff --git a/test/language/scope.rb b/test/language/scope.rb
index 32e1802a8..debef44bf 100755
--- a/test/language/scope.rb
+++ b/test/language/scope.rb
@@ -96,7 +96,7 @@ class TestScope < Test::Unit::TestCase
scope.setvar("var", "yep")
assert_equal("yep", scope.lookupvar("var"), "did not retrieve value correctly")
- # Now test the parent lookups
+ # Now test the parent lookups
subscope = mkscope :parser => parser
subscope.parent = scope
assert_equal("", subscope.lookupvar("nope"), "scope did not default to string with parent")
@@ -216,7 +216,7 @@ class TestScope < Test::Unit::TestCase
assert_equal(top, sub.parent, "Did not find parent scope correctly")
assert_equal(top, sub.parent, "Did not find parent scope on second call")
end
-
+
def test_strinterp
# Make and evaluate our classes so the qualified lookups work
parser = mkparser
diff --git a/test/language/snippets.rb b/test/language/snippets.rb
index 64681d6f9..87ad9e770 100755
--- a/test/language/snippets.rb
+++ b/test/language/snippets.rb
@@ -50,7 +50,7 @@ class TestSnippets < Test::Unit::TestCase
def snippet(name)
File.join(self.class.snippetdir, name)
end
-
+
def file2ast(file)
parser = Puppet::Parser::Parser.new()
parser.file = file
@@ -142,7 +142,7 @@ class TestSnippets < Test::Unit::TestCase
def disabled_test_defaults
Puppet::Type.eachtype { |type|
next if type.name == :puppet or type.name == :component
-
+
rands = randeach(type)
name = type.name.to_s.capitalize
@@ -417,7 +417,7 @@ class TestSnippets < Test::Unit::TestCase
assert_file("/tmp/virtualtest#{num}")
end
end
-
+
def snippet_componentrequire
%w{1 2}.each do |num|
assert_file("/tmp/testing_component_requires#{num}",
@@ -470,7 +470,7 @@ class TestSnippets < Test::Unit::TestCase
assert_file("/tmp/multipleclassone", "one")
assert_file("/tmp/multipleclasstwo", "two")
end
-
+
def snippet_multilinecomments
assert_not_file("/tmp/multilinecomments","Did create a commented resource");
end