Skip to content

Commit 0600bc0

Browse files
authored
Merge pull request #185 from DavidS/test-fixes
(maint) test fixes
2 parents 47a9879 + 45e0365 commit 0600bc0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

spec/puppet/resource_api/transport_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ class Wibble; end
260260
end
261261
end
262262

263+
after(:each) do
264+
Puppet::Util::NetworkDevice.instance_variable_set(:@current, nil)
265+
end
266+
263267
context 'when puppet has set_device' do
264268
it 'wraps the transport and calls set_device within NetworkDevice' do
265269
expect(Puppet::ResourceApi::Transport::Wrapper).to receive(:new).with(device_name, transport).and_return(wrapper)

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)