From 713a2081a9a3265d1e5218c1f88a293cd3b32a1c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 15 Feb 2025 10:50:00 +0200 Subject: can detect invalid resource names --- test/lib/dslkeywords/dependency_test.rb | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'test') 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 -- cgit v1.2.3