Skip to content

Inherit domain and authorization from superclass in Purple::Client - #25

Closed
kalashnikovisme wants to merge 2 commits into
mainfrom
codex/add-tests-for-domain-and-authorization-inheritance
Closed

Inherit domain and authorization from superclass in Purple::Client#25
kalashnikovisme wants to merge 2 commits into
mainfrom
codex/add-tests-for-domain-and-authorization-inheritance

Conversation

@kalashnikovisme

Copy link
Copy Markdown
Member

Motivation

  • Reduce duplication and allow wrapper subclasses to reuse common configuration by falling back to the superclass domain and authorization when not explicitly set on a subclass.

Description

  • Make Purple::Client.domain return @domain || inherited_domain so subclasses inherit the domain when unset and add the private helper inherited_domain that calls superclass.domain if available.
  • Make Purple::Client.authorization return @authorization || inherited_authorization so subclasses inherit authorization when unset and add the private helper inherited_authorization that calls superclass.authorization if available.
  • Add new RSpec tests in spec/purple/client_inheritance_spec.rb that verify inherited domain, inherited authorization, and the ability to override both in a subclass.

Testing

  • Added unit tests in spec/purple/client_inheritance_spec.rb (not executed in this environment).
  • Attempted to run bundle exec rspec spec/purple/client_inheritance_spec.rb spec/purple/client_spec.rb but the test run failed with bundler: command not found: rspec in the current environment.
  • Attempted bundle install to install test dependencies but it failed due to network access to rubygems.org returning HTTP 403 Forbidden, preventing the tests from being executed here.

Codex Task

@kalashnikovisme
kalashnikovisme deleted the codex/add-tests-for-domain-and-authorization-inheritance branch February 18, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant