summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-02-15 10:50:00 +0200
committerPaul Buetow <paul@buetow.org>2025-02-15 10:50:00 +0200
commit713a2081a9a3265d1e5218c1f88a293cd3b32a1c (patch)
tree80bea88e31357d554e19ed4969b57c42b9c4fb9c /test
parent8729aafe5bca25d0f7e94bd3c7ee1e0f60f99035 (diff)
can detect invalid resource names
Diffstat (limited to 'test')
-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