From 41b1f7660571db2ad7caf45b62d13b57ff8e61ea Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Wed, 26 Jul 2023 14:54:39 +0200 Subject: [PATCH] Ensure Minitest is loaded before RSpec OpenAPI The alternative to this approach would be to remove the check for `Object.const_defined?('Minitest')`, but I assume in environments where you only have RSpec, not Minitest (like when you use another framework than Rails), this would not work. --- spec/integration_tests/rails_test.rb | 3 +-- spec/integration_tests/roda_test.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/integration_tests/rails_test.rb b/spec/integration_tests/rails_test.rb index 4fb48930..64d97a6a 100644 --- a/spec/integration_tests/rails_test.rb +++ b/spec/integration_tests/rails_test.rb @@ -4,9 +4,8 @@ ENV['RAILS_ENV'] ||= 'test' ENV['OPENAPI_OUTPUT'] ||= 'yaml' -require File.expand_path('../rails/config/environment', __dir__) - require 'minitest/autorun' +require File.expand_path('../rails/config/environment', __dir__) RSpec::OpenAPI.request_headers = %w[X-Authorization-Token] RSpec::OpenAPI.response_headers = %w[X-Cursor] diff --git a/spec/integration_tests/roda_test.rb b/spec/integration_tests/roda_test.rb index 5bcc6b98..366133e4 100644 --- a/spec/integration_tests/roda_test.rb +++ b/spec/integration_tests/roda_test.rb @@ -3,8 +3,8 @@ require_relative '../roda/roda_app' require 'json' require 'rack/test' -require 'rspec/openapi' require 'minitest/autorun' +require 'rspec/openapi' ENV['OPENAPI_OUTPUT'] ||= 'yaml'