diff --git a/spec/support/helpers/disable_namespace_organization_validation_helper.rb b/spec/support/helpers/disable_namespace_organization_validation_helper.rb
index dd756c5b195a8ef5937220fa4045c5e9edfc1925..9e2ab50b3a6f3e44c304f5114d0a17c09c949de1 100644
--- a/spec/support/helpers/disable_namespace_organization_validation_helper.rb
+++ b/spec/support/helpers/disable_namespace_organization_validation_helper.rb
@@ -20,8 +20,8 @@ def full_path(path)
     end
   end
 
-  included do
-    spec_file = Pathname.new(example.metadata[:example_group][:file_path]).realpath.to_s
+  included do |base|
+    spec_file = base.metadata[:absolute_file_path]
 
     if spec_file.in?(DisableNamespaceOrganizationValidationHelper.todo_list)
       around do |example|