summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-15 02:01:58 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-15 02:01:58 +0000
commit2c57173a737bcdf12e6f3481a50e2788f5d1b4e3 (patch)
tree3641b27d4cefe2f1d123faa1b8d5f65a8d5f497f /test
parent16d9d6fe69d6eb01f7655c760d54de5986e2b3f1 (diff)
Raising element creation errors up outside the "create" method, so that tests can more easily tell when an object is invalid.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1597 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/puppettest.rb4
-rwxr-xr-xtest/types/exec.rb4
-rw-r--r--test/types/type.rb3
3 files changed, 7 insertions, 4 deletions
diff --git a/test/puppettest.rb b/test/puppettest.rb
index f094045cd..f67b2dc96 100644
--- a/test/puppettest.rb
+++ b/test/puppettest.rb
@@ -59,6 +59,10 @@ module TestPuppet
@methods = ary
end
+ def self.default?
+ false
+ end
+
def self.initvars
@calls = Hash.new do |hash, key|
hash[key] = 0
diff --git a/test/types/exec.rb b/test/types/exec.rb
index 8f0756b9f..8f09420d1 100755
--- a/test/types/exec.rb
+++ b/test/types/exec.rb
@@ -44,13 +44,11 @@ class TestExec < Test::Unit::TestCase
def test_path_or_qualified
command = nil
output = nil
- assert_nothing_raised {
+ assert_raise(Puppet::Error) {
command = Puppet.type(:exec).create(
:command => "echo"
)
- assert_nil(command)
}
- Puppet.type(:exec).clear
assert_nothing_raised {
command = Puppet.type(:exec).create(
:command => "echo",
diff --git a/test/types/type.rb b/test/types/type.rb
index 420024fb3..010102ad9 100644
--- a/test/types/type.rb
+++ b/test/types/type.rb
@@ -690,6 +690,7 @@ end
def test_defaultproviders
# Make a fake type
type = Puppet::Type.newtype(:defaultprovidertest) do
+ newparam(:name) do end
end
basic = type.provide(:basic) do
@@ -740,7 +741,7 @@ end
end
# This will fail, but earlier systems will catch it.
- assert_nothing_raised do
+ assert_raise(Puppet::Error) do
file2 = Puppet::Type.type(:file).create(
:title => "file2",
:path => path,