diff options
author | Luke Kanies <luke@madstop.com> | 2009-04-21 00:56:32 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-04-22 14:39:40 +1000 |
commit | 93246c0c70796a606fc8c05b51e1feb09c94e377 (patch) | |
tree | 8a68d8f18c695469f3be85df1ae24d2c59dde401 /test/rails/configuration.rb | |
parent | 5cb0f76f3ccb0b179de5f2735749ff91ae7346cc (diff) | |
download | puppet-93246c0c70796a606fc8c05b51e1feb09c94e377.tar.gz puppet-93246c0c70796a606fc8c05b51e1feb09c94e377.tar.xz puppet-93246c0c70796a606fc8c05b51e1feb09c94e377.zip |
Removing the old rails tests.
They don't work with the modified code, and we
rely almost entirely on manual integration testing
for this stuff anyway.
We definitely need to add tests where we can, but
these tests are totally useless.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'test/rails/configuration.rb')
-rwxr-xr-x | test/rails/configuration.rb | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/test/rails/configuration.rb b/test/rails/configuration.rb deleted file mode 100755 index a878d1381..000000000 --- a/test/rails/configuration.rb +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env ruby - -require File.dirname(__FILE__) + '/../lib/puppettest' - -require 'puppettest' -require 'puppet/parser/parser' -require 'puppet/network/client' -require 'puppet/rails' -require 'puppettest/resourcetesting' -require 'puppettest/parsertesting' -require 'puppettest/servertest' -require 'puppettest/railstesting' - - -class ConfigurationRailsTests < PuppetTest::TestCase - include PuppetTest - include PuppetTest::ServerTest - include PuppetTest::ParserTesting - include PuppetTest::ResourceTesting - include PuppetTest::RailsTesting - AST = Puppet::Parser::AST - confine "No rails support" => Puppet.features.rails? - - # We need to make sure finished objects are stored in the db. - def test_finish_before_store - railsinit - compile = mkcompiler - parser = compile.parser - - node = parser.newnode [compile.node.name], :code => AST::ASTArray.new(:children => [ - resourcedef("file", "/tmp/yay", :group => "root"), - defaultobj("file", :owner => "root") - ]) - - # Now do the rails crap - Puppet[:storeconfigs] = true - - Puppet::Rails::Host.expects(:store).with do |node, resources| - if res = resources.find { |r| r.type == "File" and r.title == "/tmp/yay" } - assert_equal("root", res["owner"], "Did not set default on resource") - true - else - raise "Resource was not passed to store()" - end - end - compile.compile - end - - def test_hoststorage - assert_nothing_raised { - Puppet[:storeconfigs] = true - } - - Puppet[:code] = "file { \"/etc\": owner => root }" - - interp = Puppet::Parser::Interpreter.new - - facts = {} - Facter.each { |fact, val| facts[fact] = val } - node = mknode(facts["hostname"]) - node.parameters = facts - - objects = nil - assert_nothing_raised { - objects = interp.compile(node) - } - - obj = Puppet::Rails::Host.find_by_name(node.name) - assert(obj, "Could not find host object") - end -end |