Fix test pollution from simulate_saas rake task

What does this MR do and why?

The simulate_saas rake task redefines Gitlab.com? to return true. While it registers an at_exit hook to restore the method, this only runs when the Ruby process exits, not after each RSpec example.

This caused test pollution when graphql_introspection_rake_spec ran before other specs (like inactive_projects_deletion_cron_worker_spec) that depend on Gitlab.com? returning its original value.

Fix by capturing the original method before tests run and restoring it in an after hook.

References

!224784 (comment 3114087359)

How to set up and validate locally

Run the following:

bundle exec rspec './spec/tasks/gitlab/graphql_introspection_rake_spec.rb[1:3:1:1]' './spec/workers/projects/inactive_projects_deletion_cron_worker_spec.rb[1:1:2:1,1:1:2:4,1:1:2:5:1]' --seed 57942

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading