Add spec coverage for Client::Helper, query_string scheme, and Errors classes - #398
Conversation
… classes Coverage dropped from 88.32% to 69.47% line coverage between v1.1.7 and v1.1.8. lib/oauth/client/ was the weakest real directory, with OAuth::Client::Helper, the query_string OAuth scheme, and the OAuth error classes having no dedicated spec files.
|
Looked into the failing checks — none of them are caused by the 5 files changed in this PR:
Happy to help address any of these separately if useful, but wanted to flag that they're unrelated to the spec changes here. |
|
Correction to my comment above — one more job is unrelated to this PR too: |
|
This looks great. I'll fix those CI issues in separate PRs. |
Summary
Closes #397
Line coverage dropped from 88.32% to 69.47% between v1.1.7 and v1.1.8.
lib/oauth/client/is the weakest real directory (~66%), and these had no dedicated spec file:OAuth::Client::Helper(lib/oauth/client/helper.rb) — used by every HTTP adapterquery_stringOAuth signing scheme inlib/oauth/client/net_http.rbOAuth::Error/OAuth::Unauthorized/OAuth::Problem(lib/oauth/errors/)This PR adds specs only — no behavior changes.
What changed
spec/oauth/client/helper_spec.rb(new) — covers#nonce,#timestamp,#oauth_parameters(incl.allow_empty_paramsvariants),#token_request?,#hash_body,#amend_user_agent_header,#header,#parameters,#parameters_with_oauthspec/net/http_spec.rb— added coverage for thequery_stringscheme (fresh query and appending to an existing one) and the URI-derivation branches in#signature_base_string(https fallback,:request_endpoint+:site)spec/oauth/error_spec.rb,spec/oauth/unauthorized_spec.rb,spec/oauth/problem_spec.rb(new) — coverOAuth::Error,OAuth::Unauthorized#to_s/#request,OAuth::Problem#to_s/#problem/#paramsspec/oauth/*_spec.rbrather than mirroringlib/oauth/errors/, sinceRSpec/SpecFilePathFormatderives the expected path from theOAuth::constant name, not thelib/directoryCHANGELOG.md—[Unreleased]entryTest plan
bundle exec kettle-test— 189 examples, 0 failures, 5 pending (unchanged, pre-existing pending specs for optional gems not installed)bundle exec rake rubocop_gradual:check— clean, only the pre-existing trackedLint/EmptyWhenviolation remainsbin/rake reek— no new smells introduced by the new/changed spec fileshelper.rb,net_http.rb, anderrors/*.rbare now exercised