Skip to content

Commit 98e859a

Browse files
committed
(maint) avoid clashing test with actual fixture
When enabling rspec-puppet support for all example groups, this test fails because of the naming clash with the real `test_simple_get_filter` type and provider in the fixtures module. Changing the name avoids this.
1 parent 9922bc6 commit 98e859a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/puppet/resource_api_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,7 +1782,7 @@ def set(_context, _changes, noop: false); end
17821782
context 'with a `simple_get_filter` provider', agent_test: true do
17831783
let(:definition) do
17841784
{
1785-
name: 'test_simple_get_filter',
1785+
name: 'test_simple_get_filter_2',
17861786
features: ['simple_get_filter'],
17871787
attributes: {
17881788
ensure: {
@@ -1796,7 +1796,7 @@ def set(_context, _changes, noop: false); end
17961796
},
17971797
}
17981798
end
1799-
let(:type) { Puppet::Type.type(:test_simple_get_filter) }
1799+
let(:type) { Puppet::Type.type(:test_simple_get_filter_2) }
18001800
let(:provider_class) do
18011801
Class.new do
18021802
def get(_context, _names = nil)
@@ -1806,11 +1806,11 @@ def get(_context, _names = nil)
18061806
def set(_context, changes) end
18071807
end
18081808
end
1809-
let(:provider) { instance_double('Puppet::Provider::TestSimpleGetFilter::TestSimpleGetFilter', 'provider') }
1809+
let(:provider) { instance_double('Puppet::Provider::TestSimpleGetFilter2::TestSimpleGetFilter2', 'provider') }
18101810

18111811
before(:each) do
1812-
stub_const('Puppet::Provider::TestSimpleGetFilter', Module.new)
1813-
stub_const('Puppet::Provider::TestSimpleGetFilter::TestSimpleGetFilter', provider_class)
1812+
stub_const('Puppet::Provider::TestSimpleGetFilter2', Module.new)
1813+
stub_const('Puppet::Provider::TestSimpleGetFilter2::TestSimpleGetFilter2', provider_class)
18141814
allow(provider_class).to receive(:new).and_return(provider)
18151815
end
18161816

@@ -1823,7 +1823,7 @@ def set(_context, changes) end
18231823

18241824
context 'with the type registered' do
18251825
it 'is seen as a supported feature' do
1826-
expect(Puppet).not_to receive(:warning).with(%r{Unknown feature detected:.*simple_test_filter})
1826+
expect(Puppet).not_to receive(:warning).with(%r{Unknown feature detected:.*simple_test_filter_2})
18271827
expect { described_class.register_type(definition) }.not_to raise_error
18281828
end
18291829

0 commit comments

Comments
 (0)