Skip to content

Commit 6448423

Browse files
committed
(maint) reset provider cache between tests
Without this the `provider` mock would leak between tests.
1 parent 7554c2f commit 6448423

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
@@ -1814,6 +1814,11 @@ def set(_context, changes) end
18141814
allow(provider_class).to receive(:new).and_return(provider)
18151815
end
18161816

1817+
after(:each) do
1818+
# reset cached provider between tests
1819+
type.instance_variable_set(:@my_provider, nil)
1820+
end
1821+
18171822
it { expect { described_class.register_type(definition) }.not_to raise_error }
18181823

18191824
context 'with the type registered' do

0 commit comments

Comments
 (0)