Description:
The OpenAPI builder specs assume the checkout directory basename is rage and hardcode "title" => "Rage" in expected output.
At the same time, the actual default OpenAPI title is built from Rage.root.basename in lib/rage/openapi/converter.rb.
That means the mocked OpenAPI builder specs become checkout-directory-dependent. If the repository is cloned into a directory whose basename is not rage, the generated default title changes and many builder specs fail even though the runtime behavior still follows the current implementation.
Steps to reproduce:
- Clone latest
main into a directory whose basename is not rage, for example rage-openapi-title-drift-20260702.
- Run:
bundle exec ruby -Ilib -e 'require "rage/all"; nodes = Rage::OpenAPI::Nodes::Root.new; puts "default_title: #{Rage::OpenAPI::Converter.new(nodes).run.fetch("info").fetch("title")}"'
bundle exec rspec spec/openapi/builder/base_spec.rb:16 --format documentation
Issue Reproduction:
Current behavior:
- the runtime default OpenAPI title follows
Rage.root.basename.
- the mocked OpenAPI builder specs hardcode
"title" => "Rage".
- in a non-
rage checkout, the builder spec suite becomes red because the expected title is no longer aligned with the generated default title.
Actual behavior:
default_title: Rage Openapi Title Drift 20260702
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"=>[]}
Expected behavior:
- the OpenAPI builder specs should stay stable regardless of the local clone folder basename.
- test setup should provide a stable mocked
Rage.root value, or otherwise avoid hardcoding a checkout-specific default title.
- this issue does not require changing the current runtime default-title policy.
Description:
The OpenAPI builder specs assume the checkout directory basename is
rageand hardcode"title" => "Rage"in expected output.At the same time, the actual default OpenAPI title is built from
Rage.root.basenameinlib/rage/openapi/converter.rb.That means the mocked OpenAPI builder specs become checkout-directory-dependent. If the repository is cloned into a directory whose basename is not
rage, the generated default title changes and many builder specs fail even though the runtime behavior still follows the current implementation.Steps to reproduce:
maininto a directory whose basename is notrage, for examplerage-openapi-title-drift-20260702.Issue Reproduction:
Current behavior:
Rage.root.basename."title" => "Rage".ragecheckout, the builder spec suite becomes red because the expected title is no longer aligned with the generated default title.Actual behavior:
Expected behavior:
Rage.rootvalue, or otherwise avoid hardcoding a checkout-specific default title.