diff options
| author | Luke Kanies <luke@reductivelabs.com> | 2010-02-06 11:34:16 -0800 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 0d704686b923c7827b9fe16f20d4f8722c125d88 (patch) | |
| tree | bc410cb6b30e8f56b6a8abae93ee8e195febb485 /test/lib/puppettest | |
| parent | ad93d0e442d4e4eff69bb3f444b2eee70a95dfa8 (diff) | |
| download | puppet-0d704686b923c7827b9fe16f20d4f8722c125d88.tar.gz puppet-0d704686b923c7827b9fe16f20d4f8722c125d88.tar.xz puppet-0d704686b923c7827b9fe16f20d4f8722c125d88.zip | |
Finishing renaming :params to :parameters internally
I had only done this partway, because it seemed easier,
but not surprisingly, it ended up being more complex.
In addition to those renames, this commit includes fixes
to whatever tests I needed to fix to confirm that things
were again working. I think most of these broken
tests have been broken for a while.
Signed-off-by: Luke Kanies <luke@reductivelabs.com>
Diffstat (limited to 'test/lib/puppettest')
| -rw-r--r-- | test/lib/puppettest/parsertesting.rb | 16 | ||||
| -rw-r--r-- | test/lib/puppettest/railstesting.rb | 2 | ||||
| -rw-r--r-- | test/lib/puppettest/resourcetesting.rb | 8 | ||||
| -rw-r--r-- | test/lib/puppettest/support/collection.rb | 29 |
4 files changed, 12 insertions, 43 deletions
diff --git a/test/lib/puppettest/parsertesting.rb b/test/lib/puppettest/parsertesting.rb index 44c78f2c3..0cc3ddef4 100644 --- a/test/lib/puppettest/parsertesting.rb +++ b/test/lib/puppettest/parsertesting.rb @@ -53,9 +53,7 @@ module PuppetTest::ParserTesting def mknode(name = nil) require 'puppet/node' - name ||= "nodename" - Puppet::Network::Handler.handler(:node) - Puppet::Node.new(name) + Puppet::Node.new(name || "nodename") end def mkparser @@ -64,9 +62,9 @@ module PuppetTest::ParserTesting end def mkscope(hash = {}) - hash[:parser] ||= mkparser - compiler ||= mkcompiler(hash[:parser]) - compiler.topscope.source = (hash[:parser].find_hostclass("", "") || hash[:parser].newclass("")) + parser ||= mkparser + compiler ||= mkcompiler + compiler.topscope.source = (parser.find_hostclass("", "") || parser.newclass("")) unless compiler.topscope.source raise "Could not find source for scope" @@ -108,7 +106,7 @@ module PuppetTest::ParserTesting :line => __LINE__, :title => title, :type => type, - :params => resourceinst(params) + :parameters => resourceinst(params) ) } end @@ -126,7 +124,7 @@ module PuppetTest::ParserTesting :line => __LINE__, :object => resourceref(type, title), :type => type, - :params => resourceinst(params) + :parameters => resourceinst(params) ) } end @@ -273,7 +271,7 @@ module PuppetTest::ParserTesting :file => __FILE__, :line => __LINE__, :type => type, - :params => past + :parameters => past ) } end diff --git a/test/lib/puppettest/railstesting.rb b/test/lib/puppettest/railstesting.rb index fb5c15f51..04ed0bf09 100644 --- a/test/lib/puppettest/railstesting.rb +++ b/test/lib/puppettest/railstesting.rb @@ -33,7 +33,7 @@ module PuppetTest::RailsTesting # Now build a resource resources = [] resources << mkresource(:type => type, :title => title, :exported => true, - :params => params) + :parameters => params) # Now collect our facts facts = Facter.to_hash diff --git a/test/lib/puppettest/resourcetesting.rb b/test/lib/puppettest/resourcetesting.rb index 95fe5bcb7..2e4db1d76 100644 --- a/test/lib/puppettest/resourcetesting.rb +++ b/test/lib/puppettest/resourcetesting.rb @@ -23,11 +23,11 @@ module PuppetTest::ResourceTesting args[param] ||= value end - params = args[:params] || {:one => "yay", :three => "rah"} - if args[:params] == :none - args.delete(:params) + params = args[:parameters] || {:one => "yay", :three => "rah"} + if args[:parameters] == :none + args.delete(:parameters) else - args[:params] = paramify args[:source], params + args[:parameters] = paramify args[:source], params end Parser::Resource.new(type, title, args) diff --git a/test/lib/puppettest/support/collection.rb b/test/lib/puppettest/support/collection.rb deleted file mode 100644 index 9da15ea81..000000000 --- a/test/lib/puppettest/support/collection.rb +++ /dev/null @@ -1,29 +0,0 @@ - -module PuppetTest::Support::Collection - def run_collection_queries(form) - {true => [%{title == "/tmp/testing"}, %{(title == "/tmp/testing")}, %{group == bin}, - %{title == "/tmp/testing" and group == bin}, %{title == bin or group == bin}, - %{title == "/tmp/testing" or title == bin}, %{title == "/tmp/testing"}, - %{(title == "/tmp/testing" or title == bin) and group == bin}], - false => [%{title == bin}, %{title == bin or (title == bin and group == bin)}, - %{title != "/tmp/testing"}, %{title != "/tmp/testing" and group != bin}] - }.each do |res, ary| - ary.each do |str| - if form == :virtual - code = "File <| #{str} |>" - else - code = "File <<| #{str} |>>" - end - parser = mkparser - query = nil - - assert_nothing_raised("Could not parse '#{str}'") do - query = parser.parse(code).hostclass("").code[0].query - end - - yield str, res, query - end - end - end -end - |
