-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use the correct matches in rspec #2112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@ekohl |
spec/classes/mod/php_spec.rb
Outdated
|
|
||
| it 'raises an error' do | ||
| expect { expect(subject).to contain_apache__mod('php5') }.to raise_error Puppet::Error, %r{mpm_module => 'prefork' or mpm_module => 'itk'} | ||
| is_expected.to compile.and_raise_error(Puppet::Error, %r{mpm_module => 'prefork' or mpm_module => 'itk'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self:
| is_expected.to compile.and_raise_error(Puppet::Error, %r{mpm_module => 'prefork' or mpm_module => 'itk'}) | |
| is_expected.to compile.and_raise_error(%r{mpm_module => 'prefork' or mpm_module => 'itk'}) |
That's great. If it gets things merged quicker I'm happy to see these changes. |
Codecov Report
@@ Coverage Diff @@
## main #2112 +/- ##
==========================================
- Coverage 57.40% 56.36% -1.05%
==========================================
Files 12 12
Lines 216 220 +4
==========================================
Hits 124 124
- Misses 92 96 +4
Continue to review full report at Codecov.
|
|
@ekohl |
Rather than checking the notify/require properties, it uses the matchers that check the dependency graph. That means it can also check transitive requires/notifies. It also uses compile and compile.and_raise_error as a shorter way to check for errors (or the absense of them).
|
There are acceptance test failures but I fail to see how they can be caused by this. |
|
@ekohl After a few rekicks everything looks green so I feel happy to merge. |
Rather than checking the notify/require properties, it uses the matchers that check the dependency graph. That means it can also check transitive requires/notifies.
It also uses compile and compile.and_raise_error as a shorter way to check for errors (or the absense of them).
This is just a tiny improvement. The specs need a major update since a lot of the examples are using hardcoded facts of EOL OSes.