Closed jcouball closed 4 months ago
@bobbrodie this PR is ready for review.
Fantastic, thanks @jcouball -- I'll get this merged along with a few others for the upcoming release
@jcouball just a heads up, this wasn't caught in CI because we haven't yet merged the preparation for v3.0.0 which runs on pull_request
, but this introduces failure:
1) JIRA::Base converts to json
Failure/Error: expect(h.to_json).to eq(h_attrs.to_json)
expected: "{\"key\":{\"foo\":\"bar\",\"dead\":\"beef\"}}"
got: "{\"key\":{\"client\":{\"__expired\":false,\"name\":\"client\"},\"attrs\":{\"foo\":\"bar\",\"dead\":\"beef\"},\"expanded\":false,\"deleted\":false}}"
Requiring active_support/core_ext/object
on HTTPError
is loading it across the project and changes the behavior of to_json
.
I updated our test here: https://github.com/sumoheavy/jira-ruby/pull/436 to get it to pass. Note that Ruby 2.4 through 2.6 won't pass, but that's expected. We're planning to drop support for those in v3.0.0 since they're EOL.
Thanks, @bobbrodie, for the info.
If
active_support/core_ext/object
was not already loaded and there is an http error, the following undefined method error would be raised:The
presence
method is defined by Active Support's Object extensions.To reproduce this issue, in the root of the project repository, save the following code to a file (say
test.rb
):and then run with the following command run in the repository's root folder:
This results in the following error:
This PR adds the require statement to load these Active Support extensions.
After this change, there is no error when the above script is run.