mspec
mspec copied to clipboard
Deprecate usage of `should_not raise_error`
Print deprecation message for every example of -> {}.should_not raise_error in specs. I believe it's enough to ensure that new specs don't contain deprecated DSL.
Related issues:
- https://github.com/ruby/spec/issues/754
Example
bin/mspec ../spec/core/proc/curry_spec.rb
$ ruby /Users/andrykonchin/projects/mspec/bin/mspec-run ../spec/core/proc/curry_spec.rb
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin18]
[/ | 0% | 00:00:00] 0F 0E
Deprecation: {}.should_not raise_error breaks code style and is deprecated
Deprecation: {}.should_not raise_error breaks code style and is deprecated
[\ | ==================100%================== | 00:00:00] 0F 0E
Finished in 0.000678 seconds
1 file, 1 example, 2 expectations, 0 failures, 0 errors, 0 tagged
I think we should start a PR on ruby/spec to fix the warnings, because if we merge and there are hundreds of warnings it will be very annoying for all people running ruby/spec.
There are about 180 examples to change. Will try to fix them soon.