Skip to content

Commit

Permalink
(maint) reset provider cache between tests
Browse files Browse the repository at this point in the history
Without this the `provider` mock would leak between tests.
  • Loading branch information
DavidS committed May 21, 2019
1 parent e7a8184 commit efaf767
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/puppet/resource_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,11 @@ def set(_context, changes) end
allow(provider_class).to receive(:new).and_return(provider)
end

after(:each) do
# reset cached provider between tests
type.instance_variable_set(:@my_provider, nil)
end

it { expect { described_class.register_type(definition) }.not_to raise_error }

it 'is seen as a supported feature' do
Expand Down

0 comments on commit efaf767

Please sign in to comment.