Skip to content

Commit 31fe0b1

Browse files
committed
(maint) reset provider cache between tests
Without this the `provider` mock would leak between tests.
1 parent 47a9879 commit 31fe0b1

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
@@ -1767,6 +1767,11 @@ def set(_context, changes) end
17671767
allow(provider_class).to receive(:new).and_return(provider)
17681768
end
17691769

1770+
after(:each) do
1771+
# reset cached provider between tests
1772+
type.instance_variable_set(:@my_provider, nil)
1773+
end
1774+
17701775
it { expect { described_class.register_type(definition) }.not_to raise_error }
17711776

17721777
it 'is seen as a supported feature' do

0 commit comments

Comments
 (0)