summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/dslkeywords/dependency_test.rb26
1 files changed, 23 insertions, 3 deletions
diff --git a/test/lib/dslkeywords/dependency_test.rb b/test/lib/dslkeywords/dependency_test.rb
index ccbaec6..3e23282 100644
--- a/test/lib/dslkeywords/dependency_test.rb
+++ b/test/lib/dslkeywords/dependency_test.rb
@@ -4,14 +4,34 @@ require 'fileutils'
require_relative '../../../lib/dsl'
class RCMDependencyTest < Minitest::Test
- def test_dependency
+ def test_depends_on
configure_from_scratch do
notify 'foo' do
- depends_on notify['bar'], file['baz']
- :HELLO
+ depends_on notify['bar'], notify['baz']
+ :foo_message
end
notify 'bar'
+
+ notify 'baz' do
+ depends_on notify['bar']
+ :baz_message
+ end
+ end
+ end
+
+ def test_depends_on_invalid_resource
+ correct_exception_thrown = false
+
+ configure_from_scratch do
+ notify 'foo' do
+ depends_on invalid['baz']
+ :foo_message
+ end
+ rescue RCM::ResourceDependencies::NoSuchResource
+ correct_exception_thrown = true
end
+
+ assert correct_exception_thrown
end
end