Skip to content

Fix HTML table generation with lazy loading - #3336

Open
sergioperezcheco wants to merge 1 commit into
faker-ruby:mainfrom
sergioperezcheco:fix/html-table-lazy-loading
Open

sergioperezcheco wants to merge 1 commit into
faker-ruby:mainfrom
sergioperezcheco:fix/html-table-lazy-loading

Conversation

@sergioperezcheco

Copy link
Copy Markdown

Motivation / Background

With FAKER_LAZY_LOAD=1, calling Faker::HTML.table in a fresh Ruby process raises NameError for Lorem. Faker::HTML.random can encounter the same failure when it chooses a table. Eager loading, or using Lorem first, masks the problem.

Qualify the table-row generator's remaining reference as Faker::Lorem, matching the other HTML methods and invoking the existing lazy loader. The regression runs in a fresh process so other tests cannot preload Lorem and hide the failure. This completes a missed reference in #3244 and does not overlap the generators fixed in #3253.

Additional information

Verified on Ruby 3.4.11/macOS: the new regression and a separate public-API reproduction fail on the original code and pass with the fix. The complete bundle exec rake passes, including RuboCop; the lazy-loading test suite and a built/installed gem also pass. Seeded eager-mode HTML output remains byte-identical. Other Ruby/OS combinations have not been run locally.

AI agents performed the investigation, implementation, independent code review, and testing; no human review is claimed.

Checklist

  • This Pull Request is related to one change.
  • Commit message describes what changed and why.
  • Tests are added for the bug fix.
  • Tests and RuboCop pass locally.

Resolve Lorem through Faker's existing lazy loader when generating table cells. Exercise the documented API in a fresh process so earlier tests cannot mask the unresolved constant.

Assisted-by: Hermes Agent
Signed-off-by: sergioperezcheco <checo520@outlook.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.

1 participant