Skip to content

Commit 7069332

Browse files
committed
(maint) reset provider cache between tests
Without this the `provider` mock would leak between tests.
1 parent 165faba commit 7069332

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/puppet/resource_api_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,6 +1787,11 @@ def set(_context, changes) end
17871787
allow(provider_class).to receive(:new).and_return(provider)
17881788
end
17891789

1790+
after(:each) do
1791+
# reset cached provider between tests
1792+
type.instance_variable_set(:@my_provider, nil)
1793+
end
1794+
17901795
it { expect { described_class.register_type(definition) }.not_to raise_error }
17911796

17921797
context 'with the type registered' do

0 commit comments

Comments
 (0)