diff options
author | Markus Roberts <Markus@reality.com> | 2010-07-09 18:06:58 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-07-09 18:06:58 -0700 |
commit | 8f15707251cdb58d53e82c4bbd332a38c2d31b4c (patch) | |
tree | b4a5df05fb8121c498cd33b67516d69af3d9853b /test | |
parent | c3e2353afb7fc2fb12efd1eb2bc5c342c792fb3b (diff) | |
download | puppet-8f15707251cdb58d53e82c4bbd332a38c2d31b4c.tar.gz puppet-8f15707251cdb58d53e82c4bbd332a38c2d31b4c.tar.xz puppet-8f15707251cdb58d53e82c4bbd332a38c2d31b4c.zip |
Code smell: Don't restate results directly after assignment
Replaced 33 occurances of
([$@]?\w+)( +[|&+-]{0,2}= .+)
\1
end
with
3 Examples:
The code:
@sync ||= Sync.new
@sync
end
becomes:
@sync ||= Sync.new
end
The code:
str += "\n"
str
end
becomes:
str += "\n"
end
The code:
@indirection = Puppet::Indirector::Indirection.new(self, indirection, options)
@indirection
end
becomes:
@indirection = Puppet::Indirector::Indirection.new(self, indirection, options)
end
Diffstat (limited to 'test')
-rwxr-xr-x | test/network/authorization.rb | 1 | ||||
-rwxr-xr-x | test/ral/manager/instances.rb | 1 | ||||
-rwxr-xr-x | test/ral/providers/cron/crontab.rb | 2 |
3 files changed, 0 insertions, 4 deletions
diff --git a/test/network/authorization.rb b/test/network/authorization.rb index 680d5676d..cecc1fd8d 100755 --- a/test/network/authorization.rb +++ b/test/network/authorization.rb @@ -48,7 +48,6 @@ class TestAuthConfig < Test::Unit::TestCase class << @obj def authconfig @authconfig ||= FakeAuth.new - @authconfig end end @request = Puppet::Network::ClientRequest.new("host", "ip", false) diff --git a/test/ral/manager/instances.rb b/test/ral/manager/instances.rb index b9ac5843a..7daa105ea 100755 --- a/test/ral/manager/instances.rb +++ b/test/ral/manager/instances.rb @@ -40,7 +40,6 @@ class TestTypeInstances < Test::Unit::TestCase end def self.instances @instances ||= names.collect { |name| instance(name) } - @instances end @names = [:one, :five, :six] diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb index 41d12c8db..0da9cc232 100755 --- a/test/ral/providers/cron/crontab.rb +++ b/test/ral/providers/cron/crontab.rb @@ -24,7 +24,6 @@ class TestCronParsedProvider < Test::Unit::TestCase # parsed, so all they def sample_crons @sample_crons ||= YAML.load(File.read(File.join(@crondir, "crontab_collections.yaml"))) - @sample_crons end # These are simple lines that can appear in the files; there is a one to one @@ -32,7 +31,6 @@ class TestCronParsedProvider < Test::Unit::TestCase # we use these records to build up our complex, multi-line cron jobs below. def sample_records @sample_records ||= YAML.load(File.read(File.join(@crondir, "crontab_sample_records.yaml"))) - @sample_records end def setup |