diff options
author | Koichi Sasada <ko1@atdot.net> | 2023-04-16 03:58:57 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2023-04-16 09:26:56 +0900 |
commit | 29e01c6f5f8901bdaab818dfd4699cfa2a86b8e6 (patch) | |
tree | 44ec5df4bb4ab11f9d8e9dd637ad9af59a71019b /regexec.c | |
parent | 52449b5b75068872ce568ed00c4c7fb8e6c28072 (diff) | |
download | ruby-29e01c6f5f8901bdaab818dfd4699cfa2a86b8e6.tar.gz |
skip if `DidYouMean.formatter=` is not defined
ruby/test_default_gems.rb can define empty `DidYouMean` module
because of the following line (second require) in the
`lib/did_you_mean/did_you_mean.gemspec`:
```ruby
begin
require_relative "lib/did_you_mean/version"
rescue LoadError # Fallback to load version file in ruby core repository
require_relative "version"
end
```
It defines only `::DidYouMean::VERSION`.
However, in the `test/ruby/test_patten_matching.rb` assumes that
if `defined?(DidYouMean)` is true, then there is a method `DidYouMean.formatter=`
and this assumption fails all tests in `test/ruby/test_patten_matching.rb` if
there is only a `::DidYouMean::VERSION`.
To reproduce the failures, we need to repeat the following command:
`make test-all TESTS='-v ruby/test_default_gems.rb ruby/pattern_matching'`
(because the ruby/test_default_gems.rb should be run before the ruby/pattern_matching`)
This patch introduces more strict gurds.
Diffstat (limited to 'regexec.c')
0 files changed, 0 insertions, 0 deletions