Skip to content

Commit

Permalink
Ensure Minitest is loaded before RSpec OpenAPI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andyundso committed Jul 26, 2023
1 parent ed1f83f commit a37d3ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions spec/integration_tests/rails_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_tests/roda_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down

0 comments on commit a37d3ec

Please sign in to comment.