Skip to content

[Specs][OpenAPI] Stabilize builder title specs across checkout names#346

Open
RedZapdos123 wants to merge 2 commits into
rage-rb:mainfrom
RedZapdos123:fix/openapi-title-spec-portability-345
Open

[Specs][OpenAPI] Stabilize builder title specs across checkout names#346
RedZapdos123 wants to merge 2 commits into
rage-rb:mainfrom
RedZapdos123:fix/openapi-title-spec-portability-345

Conversation

@RedZapdos123

@RedZapdos123 RedZapdos123 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description:

Issue #345 reported that the mocked OpenAPI builder specs hardcode "title" => "Rage" while the current default title is derived from Rage.root.basename.

This PR keeps the current runtime behavior unchanged and stabilizes the mocked OpenAPI builder specs by stubbing Rage.root to a fixed rage path in the shared mocked_rage_routes test context.

That keeps the builder specs independent of the local checkout directory basename without changing Rage::OpenAPI::Converter.

It also adds the matching changelog entry required by the repository workflow.

Closes #345.

Before fix:

$ bundle exec ruby /mnt/c/Users/Xeron/Desktop/FOSS/FOSSContributons20/.tmp/openapi-title-drift-evidence/title_repro.rb
default_title: Rage Openapi Title Drift 20260702

$ bundle exec rspec spec/openapi/builder/base_spec.rb:16 --format documentation
Run options: include {:locations=>{"./spec/openapi/builder/base_spec.rb"=>[16]}}

Rage::OpenAPI::Builder
  with no routes
    returns correct schema (FAILED - 1)

expected: {"components"=>{}, "info"=>{"title"=>"Rage", "version"=>"1.0.0"}, "openapi"=>"3.0.0", "paths"=>{}, "tags"=>[]}
got:      {"components"=>{}, "info"=>{"title"=>"Rage Openapi Title Drift 20260702", "version"=>"1.0.0"}, "openapi"=>"3.0.0", "paths"=>{}, "tags"=>[]}

1 example, 1 failure
image

After fix:

$ bundle exec ruby /mnt/c/Users/Xeron/Desktop/FOSS/FOSSContributons20/.tmp/openapi-title-drift-evidence/title_repro.rb
default_title: Rage Openapi Title Drift 20260702

$ bundle exec rspec spec/openapi/builder/base_spec.rb:16 --format documentation
Run options: include {:locations=>{"./spec/openapi/builder/base_spec.rb"=>[16]}}

Rage::OpenAPI::Builder
  with no routes
    returns correct schema

1 example, 0 failures

$ bundle exec rspec spec/openapi
427 examples, 0 failures, 1 pending
image

Checklist:

  • I have updated CHANGELOG.md.
  • I have verified the runtime default title is unchanged in a non-rage checkout using bundle exec ruby /mnt/c/Users/Xeron/Desktop/FOSS/FOSSContributons20/.tmp/openapi-title-drift-evidence/title_repro.rb.
  • I have run focused tests in WSL using bundle exec rspec spec/openapi/builder/base_spec.rb:16 --format documentation.
  • I have run OpenAPI specs in WSL using bundle exec rspec spec/openapi.

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Specs][OpenAPI] Builder specs assume checkout directory basename is rage

1 participant