From 8a641ff347d0584ea1ddc16a6ef81a8c16ab172d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 14 Mar 2026 10:47:55 +0200 Subject: Use active DSL registry for Resource.find --- test/lib/dslkeywords/requires_test.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/lib') 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 -- cgit v1.2.3