Skip to content

Commit

Permalink
Don't rescue when require 'rspec/openapi/*' raises error (#212)
Browse files Browse the repository at this point in the history
It is useful for debug.
  • Loading branch information
tricknotes committed Apr 17, 2024
1 parent 476c1a9 commit 3394219
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rspec/openapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@

begin
require 'hanami'
require 'rspec/openapi/extractors/hanami'
rescue LoadError
puts 'Hanami not detected'
else
require 'rspec/openapi/extractors/hanami'
end

begin
require 'rails'
require 'rspec/openapi/extractors/rails'
rescue LoadError
puts 'Rails not detected'
else
require 'rspec/openapi/extractors/rails'
end

require 'rspec/openapi/minitest_hooks' if Object.const_defined?('Minitest')
Expand Down

0 comments on commit 3394219

Please sign in to comment.