Skip to content

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

Description

@RedZapdos123

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:

  1. Clone latest main into a directory whose basename is not rage, for example rage-openapi-title-drift-20260702.
  2. 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:

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions