Skip to content

Commit

Permalink
Extract map iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksei committed Apr 10, 2024
1 parent dcf0d90 commit 25fa2ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/rspec/openapi/minitest_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ def run(*args)
end

def find_extractor
if Bundler.load.specs.map(&:name).include?('rails') && defined?(Rails) &&
names = Bundler.load.specs.map(&:name)

if names.include?('rails') && defined?(Rails) &&
Rails.respond_to?(:application) && Rails.application
RSpec::OpenAPI::Extractors::Rails
elsif Bundler.load.specs.map(&:name).include?('hanami') && defined?(Hanami) &&
elsif names.include?('hanami') && defined?(Hanami) &&
Hanami.respond_to?(:app) && Hanami.app?
RSpec::OpenAPI::Extractors::Hanami

Check warning on line 30 in lib/rspec/openapi/minitest_hooks.rb

View check run for this annotation

Codecov / codecov/patch

lib/rspec/openapi/minitest_hooks.rb#L30

Added line #L30 was not covered by tests
# elsif defined?(Roda)
Expand Down
6 changes: 4 additions & 2 deletions lib/rspec/openapi/rspec_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
end

def find_extractor
if Bundler.load.specs.map(&:name).include?('rails') && defined?(Rails) &&
names = Bundler.load.specs.map(&:name)

if names.include?('rails') && defined?(Rails) &&
Rails.respond_to?(:application) && Rails.application
RSpec::OpenAPI::Extractors::Rails
elsif Bundler.load.specs.map(&:name).include?('hanami') && defined?(Hanami) &&
elsif names.include?('hanami') && defined?(Hanami) &&
Hanami.respond_to?(:app) && Hanami.app?
RSpec::OpenAPI::Extractors::Hanami
# elsif defined?(Roda)
Expand Down

0 comments on commit 25fa2ff

Please sign in to comment.