summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-14 10:47:55 +0200
committerPaul Buetow <paul@buetow.org>2026-03-14 10:47:55 +0200
commit8a641ff347d0584ea1ddc16a6ef81a8c16ab172d (patch)
tree095dc715e4df2a970188e3070e7d22464401e1d3 /test
parent818ed50e2a54b40ccf7a7771bebe0312dc01a8b5 (diff)
Use active DSL registry for Resource.find
Diffstat (limited to 'test')
-rw-r--r--test/lib/dslkeywords/requires_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/lib/dslkeywords/requires_test.rb b/test/lib/dslkeywords/requires_test.rb
index 63e91ec..29c6850 100644
--- a/test/lib/dslkeywords/requires_test.rb
+++ b/test/lib/dslkeywords/requires_test.rb
@@ -1,3 +1,6 @@
+# frozen_string_literal: true
+
+# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
require 'minitest/autorun'
require 'fileutils'
@@ -71,4 +74,26 @@ class RCMRequiresTest < Minitest::Test
end
end
end
+
+ def test_configure_from_scratch_uses_current_resource_registry
+ first = second = nil
+
+ configure_from_scratch do
+ first = notify same do
+ first_run
+ end
+ end
+
+ configure_from_scratch do
+ second = notify same do
+ second_run
+ end
+ end
+
+ found = RCM::Resource.find("notify('same')")
+ refute_same first, found
+ assert_same second, found
+ end
end
+
+# rubocop:enable Metrics/AbcSize, Metrics/MethodLength