Skip to content

Commit

Permalink
💚 Skip install_tasks test on Ruby 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Feb 22, 2025
1 parent 346d9e4 commit 6381057
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# frozen_string_literal: true

# HOW TO UPDATE APPRAISALS:
# BUNDLE_GEMFILE=Appraisal.root.gemfile bundle
# BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update

# Used for head (nightly) releases of ruby, truffleruby, and jruby.
# Split into discrete appraisals if one of them needs a dependency locked discretely.
appraise "head" do
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ GEM
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-pending_for (0.1.16)
rspec-core
ruby_engine (>= 1, < 3)
ruby_version (~> 1.0)
rspec-stubbed_env (1.0.1)
rspec-support (3.13.2)
rubocop (1.71.2)
Expand Down Expand Up @@ -174,6 +178,8 @@ GEM
rubocop-thread_safety (0.6.0)
rubocop (>= 1.48.1)
ruby-progressbar (1.13.0)
ruby_engine (2.0.3)
ruby_version (1.0.3)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand Down Expand Up @@ -243,6 +249,7 @@ DEPENDENCIES
reek (~> 6.4)
rspec (~> 3.13)
rspec-block_is_expected (~> 1.0)
rspec-pending_for (~> 0.1, >= 0.1.16)
rspec-stubbed_env (~> 1.0, >= 1.0.1)
rubocop-lts (~> 8.1, >= 8.1.1)
rubocop-packaging (~> 0.5, >= 0.5.2)
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ It is different from, and improves on, the standard rake task in that it:
- does various checks to ensure the generated checksums will be valid
- does `git commit` the generated checksums

The script accomplishes the same thing if you prefer that:
```shell
gem_checksums
```

## Installation

Install the gem and add to the gem's Gemfile by executing:
Expand Down Expand Up @@ -49,6 +54,14 @@ rake build:checksums

Generating checksums makes sense when you are building and releasing a gem, so how does it fit into that process?

### Note for Ruby 2.2

The rake task is not supported on Ruby 2.2, so call the script instead like:

```shell
gem_checksums
```

### How To: Release gem with checksums generated by `gem_checksums`

NOTE: This is an example process which assumes your project has bundler binstubs, and a version.rb file,
Expand Down
1 change: 1 addition & 0 deletions gem_checksums.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Gem::Specification.new do |spec|
# Tests
spec.add_development_dependency("rspec", "~> 3.13") # ruby >= 0
spec.add_development_dependency("rspec-block_is_expected", "~> 1.0") # ruby >= 1.8.7
spec.add_development_dependency("rspec-pending_for", "~> 0.1", ">= 0.1.16") # ruby >= 1.8.7
spec.add_development_dependency("rspec-stubbed_env", "~> 1.0", ">= 1.0.1") # Ruby >= 1.8.7

# Development Tasks
Expand Down
1 change: 1 addition & 0 deletions spec/config/rspec/rspec_pending_for.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require "rspec/pending_for"
3 changes: 2 additions & 1 deletion spec/gem_checksums_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
describe "::install_tasks" do
subject(:install_tasks) { described_class.install_tasks }

it "loads vc_ruby/tasks.rb" do
it "loads gem_checksums/tasks.rb" do
skip_for(engine: "ruby", versions: "2.2.10", reason: "Minimum Ruby for install_tasks is v2.3 ")
# The order is important, spec will fail if wrong order
block_is_expected.to not_raise_error &
change { Rake.application.options.rakelib }
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# RSpec Configs
require_relative "config/byebug"
require_relative "config/rspec/rspec_block_is_expected"
require_relative "config/rspec/rspec_pending_for"
require_relative "config/rspec/rspec_stubbed_env"
require_relative "config/rspec/rspec_core"
require_relative "config/rspec/version_gem"
Expand Down

0 comments on commit 6381057

Please sign in to comment.