Skip to content

Commit 165faba

Browse files
committed
(maint) make test order really random
The test leakage fixed in the previous commit was only detected by changing the test order. Removing the seed will ensure that different test orderings are tested, leading to a more robust test suite as new issues are discovered and fixed.
1 parent 7bcd01a commit 165faba

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.rspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
--format documentation
22
--color
3-
--order rand:123
3+
--order rand

spec/puppet/resource_api_spec.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,20 +1789,22 @@ def set(_context, changes) end
17891789

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

1792-
it 'is seen as a supported feature' do
1793-
expect(Puppet).not_to receive(:warning).with(%r{Unknown feature detected:.*simple_test_filter})
1794-
expect { described_class.register_type(definition) }.not_to raise_error
1795-
end
1792+
context 'with the type registered' do
1793+
it 'is seen as a supported feature' do
1794+
expect(Puppet).not_to receive(:warning).with(%r{Unknown feature detected:.*simple_test_filter})
1795+
expect { described_class.register_type(definition) }.not_to raise_error
1796+
end
17961797

1797-
it 'passes through the an empty array to `get`' do
1798-
expect(provider).to receive(:get).with(anything, []).and_return([])
1799-
type.instances
1800-
end
1798+
it 'passes through the an empty array to `get`' do
1799+
expect(provider).to receive(:get).with(anything, []).and_return([])
1800+
type.instances
1801+
end
18011802

1802-
it 'passes through the resource title to `get`' do
1803-
instance = type.new(name: 'bar', ensure: 'present')
1804-
expect(provider).to receive(:get).with(anything, ['bar']).and_return([])
1805-
instance.retrieve
1803+
it 'passes through the resource title to `get`' do
1804+
instance = type.new(name: 'bar', ensure: 'present')
1805+
expect(provider).to receive(:get).with(anything, ['bar']).and_return([])
1806+
instance.retrieve
1807+
end
18061808
end
18071809
end
18081810

0 commit comments

Comments
 (0)