Skip to content

Commit

Permalink
Fix Minitest coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
skryukov committed Oct 14, 2024
1 parent abba661 commit c21564f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 29 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ jobs:
bundler-cache: true
- name: Run RSpec
run: bundle exec rspec
- name: Run RSpec examples
run: ruby examples/rspec.rb
- name: Fix RubyGems activating older versions of gems
run: gem install timeout net-protocol stringio psych date
- name: Install RSpec example dependencies
run: bundle install --gemfile ./examples/Gemfile-rspec
- name: Run RSpec example
run: bundle exec --gemfile ./examples/Gemfile-rspec ruby examples/rspec.rb
- name: Install minitest example dependencies
run: bundle install --gemfile ./examples/Gemfile-minitest
- name: Run minitest example
run: ruby examples/minitest.rb
- name: Run RSpec Rails examples
run: bundle exec --gemfile ./examples/Gemfile-minitest ruby examples/minitest.rb
- name: Run RSpec Rails example
working-directory: ./examples/rails_app
run: |
bundle install
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
.rspec_status

Gemfile.lock
/examples/*.lock
8 changes: 8 additions & 0 deletions examples/Gemfile-minitest
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "minitest"
gem "rack-test"
gem "skooma", (ENV["CI"] == "1") ? {path: File.join(__dir__, "..")} : {}
gem "sinatra"
8 changes: 8 additions & 0 deletions examples/Gemfile-rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "rspec"
gem "rack-test"
gem "skooma", (ENV["CI"] == "1") ? {path: File.join(__dir__, "..")} : {}
gem "sinatra"
10 changes: 0 additions & 10 deletions examples/minitest.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# frozen_string_literal: true

require "bundler/inline"

gemfile do
source "https://rubygems.org"
gem "minitest"
gem "rack-test"
gem "skooma", (ENV["CI"] == "1") ? {path: File.join(__dir__, "..")} : {}
gem "sinatra"
end

require_relative "test_app"

require "minitest/autorun"
Expand Down
13 changes: 1 addition & 12 deletions examples/rspec.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
# frozen_string_literal: true

require "bundler/inline"

gemfile do
source "https://rubygems.org"
gem "rspec"
gem "rack-test"
gem "skooma", (ENV["CI"] == "1") ? {path: File.join(__dir__, "..")} : {}
gem "sinatra"
end

require_relative "test_app"

require "rspec/autorun"
require "rack/test"
require "skooma"

RSpec.configure do |config|
Expand Down
2 changes: 1 addition & 1 deletion lib/skooma/minitest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def assert_is_valid_document(document)
def initialize(openapi_path, **params)
super(HelperMethods, openapi_path, **params)

MiniTest.after_run { coverage.report }
::Minitest.after_run { coverage.report }
end
end
end

0 comments on commit c21564f

Please sign in to comment.