bugfix: Fix potential NME when converting ParameterType to envelope#1789
bugfix: Fix potential NME when converting ParameterType to envelope#1789mitchgrout wants to merge 2 commits intocucumber:mainfrom
Conversation
|
@luke-hill relatively straight-forward fix, although I'm not super pleased with the rspec test due to the method of interest being private. I don't think this warrants an update to any of the features since it's an admittedly weird way to declare a |
luke-hill
left a comment
There was a problem hiding this comment.
Not sure I agree on no source location being provided when a bound method. because it still exists there.
But I've not dug into it in more detail
Also we need to keep the contract up. I might ask how the other flavours deal with it
| - Fixed an issue where a change to one example in compatibility testing wasn't fully adhered to ([luke-hill](https://github.com/luke-hill)) | ||
| - Fixed Ruby 3.4+ issue where error backtraces weren't being formatted. ([#1771](https://github.com/cucumber/cucumber-ruby/pull/1771) [orien](https://github.com/orien)) | ||
| - Fix some problematic specs that were leaking state and showcasing an issue on JRuby ([#1783](https://github.com/cucumber/cucumber-ruby/pull/1783) [luke-hill](https://github.com/luke-hill)) | ||
| - Fixed an issue where NoMethodError could be raised when declaring a parameter-type that used bound methods ([#1789](https://github.com/cucumber/cucumber-ruby/pull/1789)) |
There was a problem hiding this comment.
This will conflict soon as I'm about to cut v10. I will happily cut another v10.0.1 soon after if desired
| let(:prefer_for_regexp_match) { true } | ||
|
|
||
| before do | ||
| allow(configuration).to receive_message_chain(:id_generator, :new_id).and_return(id) # rubocop:disable RSpec/MessageChain |
There was a problem hiding this comment.
I'm trying to remove inline stuff, I don't mind it being added to the overall directive to be fixed up at a later date or if you can tackle it here that would be good
| regular_expressions: [%("[^"]+")], | ||
| prefer_for_regular_expression_match: true, | ||
| use_for_snippets: false, | ||
| source_reference: anything # tested in later cases |
There was a problem hiding this comment.
To avoid cop offenses can this be returned as something like :no_op
|
FYI I just encountered this at my job today. We used a lambda autofix from rubocop |
| end | ||
|
|
||
| context 'when provided a ParameterType with transformer being a lambda' do | ||
| let(:transformer) { ->(s) { s } } |
There was a problem hiding this comment.
I think is autocorrected via rubocop to lambda(&:to_s) as an example
|
Few style tweaks but other than that this is good to merge soon @mitchgrout |
|
Note to self. Rebase with main (Should fix CCK issues), fix up CR style items and merge in |
|
Hi @mitchgrout are you around and able to fix this? If not I'll try pick it up this month |
Description
Sets
source_referencetonilif the parameter type transformer does not provide a valid source location, i.e. isnil.Fixes #1788
Type of change
Bug fix (non-breaking change which fixes an issue)
Checklist:
Your PR is ready for review once the following checklist is
complete. You can also add some checks if you want to.
bundle exec rubocopreports no offenses