|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## [5.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/5.0.0) (2024-06-28) |
| 4 | + |
| 5 | +[Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/4.0.0...5.0.0) |
| 6 | + |
| 7 | +**Breaking changes:** |
| 8 | + |
| 9 | +- Switch to FacterDB 3 / drop legacy facts [\#187](https://github.com/voxpupuli/rspec-puppet-facts/pull/187) ([bastelfreak](https://github.com/bastelfreak)) |
| 10 | + |
| 11 | +**Fixed bugs:** |
| 12 | + |
| 13 | +- handle stringified facterversion properly [\#191](https://github.com/voxpupuli/rspec-puppet-facts/pull/191) ([bastelfreak](https://github.com/bastelfreak)) |
| 14 | + |
| 15 | +**Merged pull requests:** |
| 16 | + |
| 17 | +- Update voxpupuli-rubocop requirement from ~\> 2.7.0 to ~\> 2.8.0 [\#192](https://github.com/voxpupuli/rspec-puppet-facts/pull/192) ([dependabot[bot]](https://github.com/apps/dependabot)) |
| 18 | + |
3 | 19 | ## [4.0.0](https://github.com/voxpupuli/rspec-puppet-facts/tree/4.0.0) (2024-06-10) |
4 | 20 |
|
5 | 21 | [Full Changelog](https://github.com/voxpupuli/rspec-puppet-facts/compare/3.0.0...4.0.0) |
|
27 | 43 |
|
28 | 44 | **symbolized facts deprecation** |
29 | 45 |
|
30 | | -With the release of rspec-puppet-facts 4.0.0 we will remove support for symbolized facts. At the moment people typically use this in their unit files: |
| 46 | +With the release of rspec-puppet-facts 6.0.0 we will remove support for symbolized facts. At the moment people typically use this in their unit files: |
31 | 47 |
|
32 | 48 | ```ruby |
33 | | -case facts[:os]['name'] |
34 | | -when 'Archlinux' |
35 | | - context 'on Archlinux' do |
36 | | - it { is_expected.to contain_package('borg') } |
| 49 | +on_supported_os.each do |os, os_facts| |
| 50 | + case os_facts[:os]['name'] |
| 51 | + when 'Archlinux' |
| 52 | + context 'on Archlinux' do |
| 53 | + it { is_expected.to contain_package('borg') } |
| 54 | + end |
| 55 | + when 'Ubuntu' |
37 | 56 | end |
38 | | -when 'Ubuntu' |
| 57 | +end |
39 | 58 | ``` |
40 | 59 |
|
41 | | -For history reasons the first level of facts were symbols. You will have to update it to strings with the 4.0.0 release: |
| 60 | +For history reasons the first level of facts were symbols. You will have to update it to strings with the 6.0.0 release: |
42 | 61 |
|
43 | 62 | ```ruby |
44 | | -case facts['os']['name'] |
45 | | -when 'Archlinux' |
46 | | - context 'on Archlinux' do |
47 | | - it { is_expected.to contain_package('borg') } |
| 63 | +on_supported_os.each do |os, os_facts| |
| 64 | + case os_facts['os']['name'] |
| 65 | + when 'Archlinux' |
| 66 | + context 'on Archlinux' do |
| 67 | + it { is_expected.to contain_package('borg') } |
| 68 | + end |
| 69 | + when 'Ubuntu' |
48 | 70 | end |
49 | | -when 'Ubuntu' |
| 71 | +end |
50 | 72 | ``` |
51 | 73 |
|
| 74 | +As an alternative you can configure the old behaviour: |
| 75 | + |
| 76 | +```ruby |
| 77 | +RSpec.configure do |c| |
| 78 | + c.facterdb_string_keys = false |
| 79 | +end |
| 80 | +``` |
52 | 81 |
|
53 | 82 | **Breaking changes:** |
54 | 83 |
|
|
0 commit comments