diff options
| author | Paul Buetow <paul@buetow.org> | 2025-02-19 11:17:43 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-02-19 11:17:43 +0200 |
| commit | f28b8eba4937486e43292bbf2a62087a642c000d (patch) | |
| tree | 2a979bc195ae89116c837cb8d4cc7d5d9abc05b5 | |
| parent | 19d768bd12231e96e82d21ac551865d447d04b8b (diff) | |
refactor
| -rw-r--r-- | test/lib/dslkeywords/file_test.rb | 12 | ||||
| -rw-r--r-- | test/lib/dslkeywords/requires_test.rb | 16 |
2 files changed, 22 insertions, 6 deletions
diff --git a/test/lib/dslkeywords/file_test.rb b/test/lib/dslkeywords/file_test.rb index 150440c..f52d871 100644 --- a/test/lib/dslkeywords/file_test.rb +++ b/test/lib/dslkeywords/file_test.rb @@ -14,13 +14,21 @@ class RCMFileTest < Minitest::Test def test_create_file_from_string text = 'Hello World!' - configure_from_scratch { file(FILE_PATH) { text } } + configure_from_scratch do + file FILE_PATH do + text + end + end assert_equal text, File.read(FILE_PATH) end def test_create_file_from_array arr = %w[Hello World and Hello Universe] - configure_from_scratch { file(FILE_PATH) { arr } } + configure_from_scratch do + file FILE_PATH do + arr + end + end assert_equal arr.join("\n"), File.read(FILE_PATH) end diff --git a/test/lib/dslkeywords/requires_test.rb b/test/lib/dslkeywords/requires_test.rb index f06a3ec..63e91ec 100644 --- a/test/lib/dslkeywords/requires_test.rb +++ b/test/lib/dslkeywords/requires_test.rb @@ -42,7 +42,9 @@ class RCMRequiresTest < Minitest::Test def test_requires_non_existant_dependency assert_raises(RCM::Resource::NoSuchResourceObject) do configure_from_scratch do - notify { requires notify nonexistant } + notify do + requires notify nonexistant + end end end end @@ -50,7 +52,9 @@ class RCMRequiresTest < Minitest::Test def test_dependency_loop assert_raises(RCM::DependencyEvaluator::DependencyLoop) do configure_from_scratch do - notify(looper) { requires notify looper } + notify looper do + requires notify looper + end end end end @@ -58,8 +62,12 @@ class RCMRequiresTest < Minitest::Test def test_dependency_loop_indirect assert_raises(RCM::DependencyEvaluator::DependencyLoop) do configure_from_scratch do - notify(looper) { requires notify pooler } - notify(pooler) { requires notify looper } + notify looper do + requires notify pooler + end + notify pooler do + requires notify looper + end end end end |
