summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-07-09 18:06:33 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-09 18:06:33 -0700
commit8d1fbe4586c91682cdda0cb271649e918fd9778b (patch)
tree314508ca21830874d9e4ec6e27880fede14193bd /test
parent889158ad57e33df083613d6f7d136b2e11aaa16a (diff)
downloadpuppet-8d1fbe4586c91682cdda0cb271649e918fd9778b.tar.gz
puppet-8d1fbe4586c91682cdda0cb271649e918fd9778b.tar.xz
puppet-8d1fbe4586c91682cdda0cb271649e918fd9778b.zip
Code smell: Avoid explicit returns
Replaced 583 occurances of (DEF) (LINES) return (.*) end with 3 Examples: The code: def consolidate_failures(failed) filters = Hash.new { |h,k| h[k] = [] } failed.each do |spec, failed_trace| if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } filters[f] << spec break end end return filters end becomes: def consolidate_failures(failed) filters = Hash.new { |h,k| h[k] = [] } failed.each do |spec, failed_trace| if f = test_files_for(failed).find { |f| failed_trace =~ Regexp.new(f) } filters[f] << spec break end end filters end The code: def retrieve return_value = super return_value = return_value[0] if return_value && return_value.is_a?(Array) return return_value end becomes: def retrieve return_value = super return_value = return_value[0] if return_value && return_value.is_a?(Array) return_value end The code: def fake_fstab os = Facter['operatingsystem'] if os == "Solaris" name = "solaris.fstab" elsif os == "FreeBSD" name = "freebsd.fstab" else # Catchall for other fstabs name = "linux.fstab" end oldpath = @provider_class.default_target return fakefile(File::join("data/types/mount", name)) end becomes: def fake_fstab os = Facter['operatingsystem'] if os == "Solaris" name = "solaris.fstab" elsif os == "FreeBSD" name = "freebsd.fstab" else # Catchall for other fstabs name = "linux.fstab" end oldpath = @provider_class.default_target fakefile(File::join("data/types/mount", name)) end
Diffstat (limited to 'test')
-rwxr-xr-xtest/language/snippets.rb6
-rwxr-xr-xtest/lib/puppettest.rb8
-rw-r--r--test/lib/puppettest/certificates.rb8
-rw-r--r--test/lib/puppettest/exetest.rb4
-rw-r--r--test/lib/puppettest/fakes.rb2
-rw-r--r--test/lib/puppettest/filetesting.rb12
-rw-r--r--test/lib/puppettest/parsertesting.rb14
-rw-r--r--test/lib/puppettest/reporttesting.rb2
-rw-r--r--test/lib/puppettest/servertest.rb4
-rw-r--r--test/lib/puppettest/support/assertions.rb2
-rwxr-xr-xtest/lib/puppettest/support/resources.rb4
-rw-r--r--test/lib/puppettest/support/utils.rb8
-rw-r--r--test/lib/rake/puppet_testtask.rb2
-rwxr-xr-xtest/network/authstore.rb2
-rwxr-xr-xtest/network/handler/fileserver.rb4
-rwxr-xr-xtest/network/xmlrpc/processor.rb2
-rwxr-xr-xtest/other/provider.rb2
-rwxr-xr-xtest/other/report.rb2
-rwxr-xr-xtest/other/transactions.rb4
-rwxr-xr-xtest/ral/manager/attributes.rb2
-rwxr-xr-xtest/ral/manager/type.rb4
-rwxr-xr-xtest/ral/providers/group.rb6
-rwxr-xr-xtest/ral/providers/host/parsed.rb2
-rwxr-xr-xtest/ral/providers/mailalias/aliases.rb2
-rwxr-xr-xtest/ral/providers/package.rb2
-rwxr-xr-xtest/ral/providers/provider.rb4
-rwxr-xr-xtest/ral/providers/sshkey/parsed.rb2
-rwxr-xr-xtest/ral/providers/user.rb6
-rwxr-xr-xtest/ral/type/cron.rb2
-rwxr-xr-xtest/ral/type/file.rb2
-rwxr-xr-xtest/ral/type/filesources.rb4
-rwxr-xr-xtest/ral/type/host.rb2
-rwxr-xr-xtest/ral/type/sshkey.rb2
-rwxr-xr-xtest/ral/type/user.rb2
-rwxr-xr-xtest/ral/type/yumrepo.rb2
-rwxr-xr-xtest/ral/type/zone.rb2
-rwxr-xr-xtest/util/inifile.rb4
-rwxr-xr-xtest/util/log.rb2
-rwxr-xr-xtest/util/metrics.rb2
-rwxr-xr-xtest/util/settings.rb2
-rwxr-xr-xtest/util/storage.rb2
41 files changed, 76 insertions, 76 deletions
diff --git a/test/language/snippets.rb b/test/language/snippets.rb
index c42d67397..fe22e46bf 100755
--- a/test/language/snippets.rb
+++ b/test/language/snippets.rb
@@ -55,7 +55,7 @@ class TestSnippets < Test::Unit::TestCase
parser.file = file
ast = parser.parse
- return ast
+ ast
end
def snippet2ast(text)
@@ -63,7 +63,7 @@ class TestSnippets < Test::Unit::TestCase
parser.string = text
ast = parser.parse
- return ast
+ ast
end
def client
@@ -77,7 +77,7 @@ class TestSnippets < Test::Unit::TestCase
scope = Puppet::Parser::Scope.new()
ast.evaluate(scope)
- return scope
+ scope
end
def scope2objs(scope)
diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb
index e5a1dce80..22e7a3b37 100755
--- a/test/lib/puppettest.rb
+++ b/test/lib/puppettest.rb
@@ -90,7 +90,7 @@ module PuppetTest
# what makes things like '-n' work).
opts.each { |o| ARGV << o }
- return args
+ args
end
# Find the root of the Puppet tree; this is not the test directory, but
@@ -237,17 +237,17 @@ module PuppetTest
f = File.join(self.tmpdir(), "tempfile_" + @@tmpfilenum.to_s)
@@tmpfiles ||= []
@@tmpfiles << f
- return f
+ f
end
def textmate?
- return !!ENV["TM_FILENAME"]
+ !!ENV["TM_FILENAME"]
end
def tstdir
dir = tempfile()
Dir.mkdir(dir)
- return dir
+ dir
end
def tmpdir
diff --git a/test/lib/puppettest/certificates.rb b/test/lib/puppettest/certificates.rb
index 198ec96c4..9ab64d762 100644
--- a/test/lib/puppettest/certificates.rb
+++ b/test/lib/puppettest/certificates.rb
@@ -13,7 +13,7 @@ module PuppetTest::Certificates
f.print "as;dklj23rlkjzdflij23wr"
}
- return keyfile
+ keyfile
end
def mkCA
@@ -22,7 +22,7 @@ module PuppetTest::Certificates
ca = Puppet::SSLCertificates::CA.new()
}
- return ca
+ ca
end
def mkStore(ca)
@@ -41,7 +41,7 @@ module PuppetTest::Certificates
cert.mkcsr
}
- return cert
+ cert
end
def mksignedcert(ca = nil, hostname = nil)
@@ -52,7 +52,7 @@ module PuppetTest::Certificates
assert_nothing_raised {
cert, cacert = ca.sign(mkcert(hostname).mkcsr)
}
- return cert
+ cert
end
end
diff --git a/test/lib/puppettest/exetest.rb b/test/lib/puppettest/exetest.rb
index 78f391ddd..105ebc11c 100644
--- a/test/lib/puppettest/exetest.rb
+++ b/test/lib/puppettest/exetest.rb
@@ -39,7 +39,7 @@ module PuppetTest::ExeTest
Dir.chdir(bindir()) {
out = %x{#{@ruby} #{cmd}}
}
- return out
+ out
end
def startmasterd(args = "")
@@ -75,7 +75,7 @@ module PuppetTest::ExeTest
sleep(1)
end
- return manifest
+ manifest
end
def stopmasterd(running = true)
diff --git a/test/lib/puppettest/fakes.rb b/test/lib/puppettest/fakes.rb
index 2db045ab5..a05d0f5c5 100644
--- a/test/lib/puppettest/fakes.rb
+++ b/test/lib/puppettest/fakes.rb
@@ -149,7 +149,7 @@ module PuppetTest
end
end
- return ret
+ ret
end
def store(hash)
diff --git a/test/lib/puppettest/filetesting.rb b/test/lib/puppettest/filetesting.rb
index 2ecfce58f..6f07c2ad4 100644
--- a/test/lib/puppettest/filetesting.rb
+++ b/test/lib/puppettest/filetesting.rb
@@ -26,7 +26,7 @@ module PuppetTest::FileTesting
ret.push item
}
- return ret
+ ret
end
def mkranddirsandfiles(dirs = nil,files = nil,depth = 3)
@@ -63,7 +63,7 @@ module PuppetTest::FileTesting
FileUtils.cd(dir) {
list = %x{find . 2>/dev/null}.chomp.split(/\n/)
}
- return list
+ list
end
def assert_trees_equal(fromdir,todir)
@@ -145,7 +145,7 @@ module PuppetTest::FileTesting
end
}
- return deleted
+ deleted
end
def add_random_files(dir)
@@ -168,7 +168,7 @@ module PuppetTest::FileTesting
false
end
}
- return added
+ added
end
def modify_random_files(dir)
@@ -191,7 +191,7 @@ module PuppetTest::FileTesting
false
end
}
- return modded
+ modded
end
def readonly_random_files(dir)
@@ -211,7 +211,7 @@ module PuppetTest::FileTesting
false
end
}
- return modded
+ modded
end
def conffile
diff --git a/test/lib/puppettest/parsertesting.rb b/test/lib/puppettest/parsertesting.rb
index a23bd5601..1165773fd 100644
--- a/test/lib/puppettest/parsertesting.rb
+++ b/test/lib/puppettest/parsertesting.rb
@@ -17,7 +17,7 @@ module PuppetTest::ParserTesting
def evaluate(*args)
@evaluated = true
- return @evaluate
+ @evaluate
end
def initialize(val = nil)
@@ -46,7 +46,7 @@ module PuppetTest::ParserTesting
def mkcompiler(parser = nil)
node = mknode
- return Compiler.new(node)
+ Compiler.new(node)
end
def mknode(name = nil)
@@ -330,7 +330,7 @@ module PuppetTest::ParserTesting
)
end
- return func
+ func
end
# This assumes no nodes
@@ -356,7 +356,7 @@ module PuppetTest::ParserTesting
obj["mode"] = "644"
}
- return obj
+ obj
end
def mk_transbucket(*resources)
@@ -369,7 +369,7 @@ module PuppetTest::ParserTesting
resources.each { |o| bucket << o }
- return bucket
+ bucket
end
# Make a tree of resources, yielding if desired
@@ -404,7 +404,7 @@ module PuppetTest::ParserTesting
bucket = newbucket
end
- return top
+ top
end
# Take a list of AST resources, evaluate them, and return the results
@@ -423,6 +423,6 @@ module PuppetTest::ParserTesting
trans = scope.evaluate(:ast => top)
}
- return trans
+ trans
end
end
diff --git a/test/lib/puppettest/reporttesting.rb b/test/lib/puppettest/reporttesting.rb
index 49520d23a..b0cb0f2ec 100644
--- a/test/lib/puppettest/reporttesting.rb
+++ b/test/lib/puppettest/reporttesting.rb
@@ -10,7 +10,7 @@ module PuppetTest::Reporttesting
report << log
}
- return report
+ report
end
end
diff --git a/test/lib/puppettest/servertest.rb b/test/lib/puppettest/servertest.rb
index 0a7b7f01a..df78159c8 100644
--- a/test/lib/puppettest/servertest.rb
+++ b/test/lib/puppettest/servertest.rb
@@ -27,7 +27,7 @@ module PuppetTest::ServerTest
@@tmpfiles << @createdfile
@@tmpfiles << file
- return file
+ file
end
# create a server, forked into the background
@@ -67,7 +67,7 @@ module PuppetTest::ServerTest
# give the server a chance to do its thing
sleep 1
- return spid
+ spid
end
end
diff --git a/test/lib/puppettest/support/assertions.rb b/test/lib/puppettest/support/assertions.rb
index b918e28f6..8426869eb 100644
--- a/test/lib/puppettest/support/assertions.rb
+++ b/test/lib/puppettest/support/assertions.rb
@@ -50,7 +50,7 @@ module PuppetTest
run_events(:evaluate, transaction, events, msg)
- return transaction
+ transaction
end
# A simpler method that just applies what we have.
diff --git a/test/lib/puppettest/support/resources.rb b/test/lib/puppettest/support/resources.rb
index 6b771dda8..0eec20aae 100755
--- a/test/lib/puppettest/support/resources.rb
+++ b/test/lib/puppettest/support/resources.rb
@@ -19,7 +19,7 @@ module PuppetTest::Support::Resources
config.add_edge(comp, resource)
config.add_resource resource unless config.resource(resource.ref)
end
- return comp
+ comp
end
def mktree
@@ -30,6 +30,6 @@ module PuppetTest::Support::Resources
top = treenode(config, "top", "g", "h", middle, one)
end
- return catalog
+ catalog
end
end
diff --git a/test/lib/puppettest/support/utils.rb b/test/lib/puppettest/support/utils.rb
index 61ab6e754..466798abe 100644
--- a/test/lib/puppettest/support/utils.rb
+++ b/test/lib/puppettest/support/utils.rb
@@ -35,7 +35,7 @@ module PuppetTest::Support::Utils
config = Puppet::Resource::Catalog.new
resources.each { |res| config.add_resource res }
end
- return config
+ config
end
# stop any services that might be hanging around
@@ -80,7 +80,7 @@ module PuppetTest::Support::Utils
assert_equal(events, newevents, "Incorrect #{type} #{msg} events")
- return trans
+ trans
end
def fakefile(name)
@@ -88,7 +88,7 @@ module PuppetTest::Support::Utils
ary += name.split("/")
file = File.join(ary)
raise Puppet::DevError, "No fakedata file #{file}" unless FileTest.exists?(file)
- return file
+ file
end
# wrap how to retrieve the masked mode
@@ -137,7 +137,7 @@ module PuppetTest::Support::Utils
resources.each { |resource| conf.add_resource resource }
end
- return config
+ config
end
end
diff --git a/test/lib/rake/puppet_testtask.rb b/test/lib/rake/puppet_testtask.rb
index a4b8d8b7f..dfdf72332 100644
--- a/test/lib/rake/puppet_testtask.rb
+++ b/test/lib/rake/puppet_testtask.rb
@@ -12,7 +12,7 @@ module Rake
file = find_file('rake/puppet_test_loader') or
fail "unable to find rake test loader"
end
- return file
+ file
end
end
end
diff --git a/test/network/authstore.rb b/test/network/authstore.rb
index 72c4ee584..9837a4686 100755
--- a/test/network/authstore.rb
+++ b/test/network/authstore.rb
@@ -15,7 +15,7 @@ class TestAuthStore < Test::Unit::TestCase
store = Puppet::Network::AuthStore.new
}
- return store
+ store
end
def setup
diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb
index 32951bcce..667adb853 100755
--- a/test/network/handler/fileserver.rb
+++ b/test/network/handler/fileserver.rb
@@ -19,7 +19,7 @@ class TestFileServer < Test::Unit::TestCase
mount = Puppet::Network::Handler.fileserver::Mount.new(name, base)
}
- return mount
+ mount
end
# make a simple file source
def mktestdir
@@ -36,7 +36,7 @@ class TestFileServer < Test::Unit::TestCase
}
}
- return [testdir, %r{#{pattern}}, tmpfile]
+ [testdir, %r{#{pattern}}, tmpfile]
end
# make a bunch of random test files
diff --git a/test/network/xmlrpc/processor.rb b/test/network/xmlrpc/processor.rb
index 0b0646728..69f4c2fdc 100755
--- a/test/network/xmlrpc/processor.rb
+++ b/test/network/xmlrpc/processor.rb
@@ -51,7 +51,7 @@ class TestXMLRPCProcessor < Test::Unit::TestCase
fakeparser = Class.new do
def parseMethodCall(data)
- return data
+ data
end
end
diff --git a/test/other/provider.rb b/test/other/provider.rb
index e746a330a..341c364f4 100755
--- a/test/other/provider.rb
+++ b/test/other/provider.rb
@@ -30,7 +30,7 @@ class TestImpl < Test::Unit::TestCase
assert_nothing_raised("Could not create provider") do
provider = type.provide(name) {}
end
- return provider
+ provider
end
def test_provider_default
diff --git a/test/other/report.rb b/test/other/report.rb
index b5cbec0c3..d15fb5505 100755
--- a/test/other/report.rb
+++ b/test/other/report.rb
@@ -38,7 +38,7 @@ class TestReports < Test::Unit::TestCase
report = Puppet::Transaction::Report.new
trans.add_metrics_to_report(report)
- return report
+ report
end
# Make sure we can use reports as log destinations.
diff --git a/test/other/transactions.rb b/test/other/transactions.rb
index fa4fa4f61..dd5348e33 100755
--- a/test/other/transactions.rb
+++ b/test/other/transactions.rb
@@ -51,7 +51,7 @@ class TestTransactions < Test::Unit::TestCase
Puppet::Type.rmtype(:generator)
end
- return type
+ type
end
# Create a new type that generates instances with shorter names.
@@ -70,7 +70,7 @@ class TestTransactions < Test::Unit::TestCase
type.class_eval(&block) if block
- return type
+ type
end
def test_prefetch
diff --git a/test/ral/manager/attributes.rb b/test/ral/manager/attributes.rb
index 95a077620..24edf37dc 100755
--- a/test/ral/manager/attributes.rb
+++ b/test/ral/manager/attributes.rb
@@ -276,7 +276,7 @@ class TestTypeAttributes < Test::Unit::TestCase
$yep = :absent
type.provide(:only) do
def self.supports_parameter?(param)
- return param.name != :nope
+ param.name != :nope
end
def yep
diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb
index 9182dab09..5190bc7c7 100755
--- a/test/ral/manager/type.rb
+++ b/test/ral/manager/type.rb
@@ -177,10 +177,10 @@ class TestType < Test::Unit::TestCase
# Create a type with a fake provider
providerclass = Class.new do
def self.supports_parameter?(prop)
- return true
+ true
end
def method_missing(method, *args)
- return method
+ method
end
end
self.class.const_set("ProviderClass", providerclass)
diff --git a/test/ral/providers/group.rb b/test/ral/providers/group.rb
index 6a0d20268..48120f332 100755
--- a/test/ral/providers/group.rb
+++ b/test/ral/providers/group.rb
@@ -41,7 +41,7 @@ class TestGroupProvider < Test::Unit::TestCase
}
assert(group, "Could not create provider group")
- return group
+ group
end
case Facter["operatingsystem"].value
@@ -63,7 +63,7 @@ class TestGroupProvider < Test::Unit::TestCase
end
}
- return nil
+ nil
end
def remove(group)
@@ -85,7 +85,7 @@ class TestGroupProvider < Test::Unit::TestCase
return obj.gid
}
- return nil
+ nil
end
def remove(group)
diff --git a/test/ral/providers/host/parsed.rb b/test/ral/providers/host/parsed.rb
index 2060276d7..d14e33f7b 100755
--- a/test/ral/providers/host/parsed.rb
+++ b/test/ral/providers/host/parsed.rb
@@ -62,7 +62,7 @@ class TestParsedHostProvider < Test::Unit::TestCase
host.send(name.to_s + "=", val)
end
- return host
+ host
end
# Make sure we convert both directlys correctly using a simple host.
diff --git a/test/ral/providers/mailalias/aliases.rb b/test/ral/providers/mailalias/aliases.rb
index 76bbc60c6..8c2626ee9 100755
--- a/test/ral/providers/mailalias/aliases.rb
+++ b/test/ral/providers/mailalias/aliases.rb
@@ -43,7 +43,7 @@ class TestMailaliasAliasesProvider < Test::Unit::TestCase
key.send(p.to_s + "=", v)
end
- return key
+ key
end
def test_data_parsing_and_generating
diff --git a/test/ral/providers/package.rb b/test/ral/providers/package.rb
index 03b81477d..b91f5d92d 100755
--- a/test/ral/providers/package.rb
+++ b/test/ral/providers/package.rb
@@ -33,7 +33,7 @@ class TestPackageProvider < Test::Unit::TestCase
end
}
- return array
+ array
end
def self.suitable_test_packages
diff --git a/test/ral/providers/provider.rb b/test/ral/providers/provider.rb
index 081020638..3ffbfd985 100755
--- a/test/ral/providers/provider.rb
+++ b/test/ral/providers/provider.rb
@@ -13,7 +13,7 @@ class TestProvider < Test::Unit::TestCase
raise "Could not find 'echo' binary; cannot complete test" unless echo
- return echo
+ echo
end
def newprovider
@@ -23,7 +23,7 @@ class TestProvider < Test::Unit::TestCase
end
provider.initvars
- return provider
+ provider
end
def setup
diff --git a/test/ral/providers/sshkey/parsed.rb b/test/ral/providers/sshkey/parsed.rb
index e58f59173..2b4d3a603 100755
--- a/test/ral/providers/sshkey/parsed.rb
+++ b/test/ral/providers/sshkey/parsed.rb
@@ -44,7 +44,7 @@ class TestParsedSSHKey < Test::Unit::TestCase
key.send(p.to_s + "=", v)
end
- return key
+ key
end
def test_keysparse
diff --git a/test/ral/providers/user.rb b/test/ral/providers/user.rb
index 793b6493e..033632894 100755
--- a/test/ral/providers/user.rb
+++ b/test/ral/providers/user.rb
@@ -57,7 +57,7 @@ class TestUserProvider < Test::Unit::TestCase
end
}
- return nil
+ nil
end
def remove(user)
@@ -83,7 +83,7 @@ class TestUserProvider < Test::Unit::TestCase
return obj.send(user.posixmethod(param))
}
- return nil
+ nil
end
def remove(user)
@@ -146,7 +146,7 @@ class TestUserProvider < Test::Unit::TestCase
}
assert(user, "Could not create provider user")
- return user
+ user
end
def test_list
diff --git a/test/ral/type/cron.rb b/test/ral/type/cron.rb
index 37cba1b3c..384a6ad32 100755
--- a/test/ral/type/cron.rb
+++ b/test/ral/type/cron.rb
@@ -76,7 +76,7 @@ class TestCron < Test::Unit::TestCase
cron = @crontype.new(args)
}
- return cron
+ cron
end
# Run the cron through its paces -- install it then remove it.
diff --git a/test/ral/type/file.rb b/test/ral/type/file.rb
index f7c4c2b2a..726dcb72f 100755
--- a/test/ral/type/file.rb
+++ b/test/ral/type/file.rb
@@ -16,7 +16,7 @@ class TestFile < Test::Unit::TestCase
assert_nothing_raised {
file = Puppet::Type.type(:file).new(hash)
}
- return file
+ file
end
def mktestfile
diff --git a/test/ral/type/filesources.rb b/test/ral/type/filesources.rb
index 7541a7cbe..d3eb537c1 100755
--- a/test/ral/type/filesources.rb
+++ b/test/ral/type/filesources.rb
@@ -93,7 +93,7 @@ class TestFileSources < Test::Unit::TestCase
source = "puppet://localhost/#{networked}#{fromdir}" if networked
recursive_source_test(source, todir)
- return [fromdir,todir, File.join(todir, "one"), File.join(todir, "two")]
+ [fromdir,todir, File.join(todir, "one"), File.join(todir, "two")]
end
def test_complex_sources_twice
@@ -226,7 +226,7 @@ class TestFileSources < Test::Unit::TestCase
}
@@tmpfiles << file
- return file
+ file
end
def test_unmountedNetworkSources
diff --git a/test/ral/type/host.rb b/test/ral/type/host.rb
index 3259e3ae9..2715f6438 100755
--- a/test/ral/type/host.rb
+++ b/test/ral/type/host.rb
@@ -54,7 +54,7 @@ class TestHost < Test::Unit::TestCase
)
}
- return host
+ host
end
def test_list
diff --git a/test/ral/type/sshkey.rb b/test/ral/type/sshkey.rb
index 01d72156a..4e5525bd3 100755
--- a/test/ral/type/sshkey.rb
+++ b/test/ral/type/sshkey.rb
@@ -59,7 +59,7 @@ class TestSSHKey < Test::Unit::TestCase
@catalog.add_resource(key)
- return key
+ key
end
def test_instances
diff --git a/test/ral/type/user.rb b/test/ral/type/user.rb
index 3187101e1..fd5dcd199 100755
--- a/test/ral/type/user.rb
+++ b/test/ral/type/user.rb
@@ -78,7 +78,7 @@ class TestUser < Test::Unit::TestCase
assert(user, "Did not create user")
- return user
+ user
end
def test_autorequire
diff --git a/test/ral/type/yumrepo.rb b/test/ral/type/yumrepo.rb
index fcfd73f99..8efa83518 100755
--- a/test/ral/type/yumrepo.rb
+++ b/test/ral/type/yumrepo.rb
@@ -89,7 +89,7 @@ class TestYumRepo < Test::Unit::TestCase
def all_sections(inifile)
sections = []
inifile.each_section { |section| sections << section.name }
- return sections.sort
+ sections.sort
end
def copy_datafiles
diff --git a/test/ral/type/zone.rb b/test/ral/type/zone.rb
index c136fbfb1..f6ef98a6e 100755
--- a/test/ral/type/zone.rb
+++ b/test/ral/type/zone.rb
@@ -33,7 +33,7 @@ class TestZone < PuppetTest::TestCase
@@zones << name
- return zone
+ zone
end
def test_instances
diff --git a/test/util/inifile.rb b/test/util/inifile.rb
index c33a27ecd..2d5841ca0 100755
--- a/test/util/inifile.rb
+++ b/test/util/inifile.rb
@@ -127,12 +127,12 @@ class TestFileType < Test::Unit::TestCase
def get_section(name)
result = @file[name]
assert_not_nil(result)
- return result
+ result
end
def mkfile(content)
file = tempfile()
File.open(file, "w") { |f| f.print(content) }
- return file
+ file
end
end
diff --git a/test/util/log.rb b/test/util/log.rb
index b33e1d2fe..cbaa71a55 100755
--- a/test/util/log.rb
+++ b/test/util/log.rb
@@ -28,7 +28,7 @@ class TestLog < Test::Unit::TestCase
Puppet::Util::Log.eachlevel { |level| levels << level }
}
# Don't test the top levels; too annoying
- return levels.reject { |level| level == :emerg or level == :crit }
+ levels.reject { |level| level == :emerg or level == :crit }
end
def mkmsgs(levels)
diff --git a/test/util/metrics.rb b/test/util/metrics.rb
index 70b85cebd..2575330b5 100755
--- a/test/util/metrics.rb
+++ b/test/util/metrics.rb
@@ -37,7 +37,7 @@ class TestMetric < PuppetTest::TestCase
eventdata[event] = rand(eventmax)
}
- return {:typedata => typedata, :eventdata => eventdata}
+ {:typedata => typedata, :eventdata => eventdata}
end
def rundata(report, time)
diff --git a/test/util/settings.rb b/test/util/settings.rb
index fa47a1227..2e2d0b019 100755
--- a/test/util/settings.rb
+++ b/test/util/settings.rb
@@ -86,7 +86,7 @@ class TestSettings < Test::Unit::TestCase
def mkconfig
c = Puppet::Util::Settings.new
c.setdefaults :main, :noop => [false, "foo"]
- return c
+ c
end
def test_addbools
diff --git a/test/util/storage.rb b/test/util/storage.rb
index 2259a59d2..ae28bf992 100755
--- a/test/util/storage.rb
+++ b/test/util/storage.rb
@@ -20,7 +20,7 @@ class TestStorage < Test::Unit::TestCase
:check => %w{checksum type}
)
- return f
+ f
end
def test_storeandretrieve