Skip to content

Commit

Permalink
Upgrade Minitest to version 5.22.x (Drop Ruby 2.4 and 2.5 from CI) (#115
Browse files Browse the repository at this point in the history
)

* Update code sample to use the latest version of skunk

* Bump minitest dependency to 5.20.0

* Address deprecation warning (minitest)

* Address deprecation warning (minitest)

* Stop testing library with Ruby 2.4 and 2.5

Minitest no longer supports Ruby 2.4 and 2.5, so then this is a reasonable change

* Add entry in CHANGELOG

Add a title for #115

* Bump minitest to version 5.22.x

* Update changelog with the right version number

Make the minitest dependency definition more open
  • Loading branch information
etagwerker committed Mar 2, 2024
1 parent 047e28d commit 6917bc8
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 67 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,6 @@ name: CI
on: [push, pull_request]

jobs:
test-ruby-2-4-x:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Ruby 2.4
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.4
- name: Build and run tests
env:
BUNDLE_GEMFILE: "Gemfile-Ruby-2-4"
run: |
gem install bundler -v 2.3
bundle install --jobs 4 --retry 3
bundle exec rake
test-ruby-2-5-x:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Ruby 2.5
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
- name: Build and run tests
env:
BUNDLE_GEMFILE: "Gemfile-Ruby-2-5"
run: |
gem install bundler -v 2.3.26
bundle install --jobs 4 --retry 3
bundle exec rake
test-ruby:
runs-on: ${{ matrix.os }}-latest
strategy:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* <INSERT YOUR FEATURE OR BUGFIX HERE>

* [ENHANCEMENT: Better test suite with more relaxed console output expectation](https://github.com/fastruby/skunk/pull/117)
* [ENHANCEMENT: Use minitest 5.22.x (also, stop testing with Ruby 2.4 and 2.5)](https://github.com/fastruby/skunk/pull/115)

## v0.5.3 / 2023-12-01 [(commits)](https://github.com/fastruby/skunk/compare/v0.5.2...v0.5.3)

Expand Down
13 changes: 0 additions & 13 deletions Gemfile-Ruby-2-4

This file was deleted.

13 changes: 0 additions & 13 deletions Gemfile-Ruby-2-5

This file was deleted.

2 changes: 1 addition & 1 deletion skunk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Gem::Specification.new do |spec|

spec.add_development_dependency "codecov", "~> 0.1.16"
spec.add_development_dependency "debug"
spec.add_development_dependency "minitest", "~> 5.8.4"
spec.add_development_dependency "minitest", "< 6"
spec.add_development_dependency "minitest-around", "~> 0.5.0"
spec.add_development_dependency "minitest-stub_any_instance", "~> 1.0.2"
spec.add_development_dependency "minitest-stub-const", "~> 0.6"
Expand Down
12 changes: 5 additions & 7 deletions test/lib/skunk/commands/compare_score_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,28 @@
"Skunk score average is 80% better \n"

compare_score = Skunk::Command::CompareScore.new("main", "feature", 10, 2)
compare_score.message.must_equal expected
_(compare_score.message).must_equal expected
end
end
describe "#score_evolution_message" do
it "computes skunk score_evolution_message with negative impact" do
compare_score = Skunk::Command::CompareScore.new("main", "feature", 10.1, 12.1)
compare_score.score_evolution_message.must_equal "Skunk score average is 20% worse \n"
_(compare_score.score_evolution_message).must_equal "Skunk score average is 20% worse \n"
end

it "computes skunk score_evolution_message with positive impact" do
compare_score = Skunk::Command::CompareScore.new("main", "feature", 12.1, 8)
compare_score.score_evolution_message.must_equal "Skunk score average is 34% better \n"
_(compare_score.score_evolution_message).must_equal "Skunk score average is 34% better \n"
end

it "computes skunk score_evolution_message when base_branch_score is 0" do
compare_score = Skunk::Command::CompareScore.new("main", "feature", 0, 2)
compare_score
.score_evolution_message
.must_equal "Skunk score average is Infinitely worse \n"
_(compare_score.score_evolution_message).must_equal "Skunk score average is Infinitely worse \n"
end

it "computes skunk score_evolution_message when feature_branch_score is 0" do
compare_score = Skunk::Command::CompareScore.new("main", "feature", 10, 0)
compare_score.score_evolution_message.must_equal "Skunk score average is 100% better \n"
_(compare_score.score_evolution_message).must_equal "Skunk score average is 100% better \n"
end
end
end
2 changes: 1 addition & 1 deletion test/samples/console_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
SkunkScore Total: 0.59
Modules Analysed: 1
SkunkScore Average: 0.59
Worst SkunkScore: 0.59 (samples/rubycritic/analysed_module.rb)
Worst SkunkScore: 0.59 (samples/rubycritic/analysed_module.rb)

0 comments on commit 6917bc8

Please sign in to comment.