Skip to content

Commit

Permalink
Merge pull request #29 from inkstak/fix_test_suite
Browse files Browse the repository at this point in the history
Update test suite & appraisal setup
  • Loading branch information
inkstak authored Aug 10, 2023
2 parents 6d67948 + 4ef92c2 commit a63b970
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ gemspec

gem "gem-release"
gem "simplecov_json_formatter"

# FIXME: waiting for appraisal to support Ruby 3.2
# https://github.com/thoughtbot/appraisal/issues/199
gem "appraisal", github: "thoughtbot/appraisal"
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,16 @@ bundle exec rubocop
bundle exec standardrb
```

All of them can be run with:

To run RSpec against various version of Rails dependencies:
```bash
bundle exec rake
bundle exec appraisal install
bundle exec appraisal rspec
```

To run test suite against various version of Rails dependencies:
All of them can be run with:

```bash
bundle exec appraisal install
bundle exec appraisal
bundle exec rake
```

## License & credits
Expand Down
25 changes: 18 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "appraisal"
require "rspec/core/rake_task"
require "rubocop/rake_task"
require "standard/rake"

RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new

desc "Run the full CI"
task :default do
Rake::Task["spec"].invoke
Rake::Task["rubocop"].invoke
if ENV["APPRAISAL_INITIALIZED"]
Rake::Task["spec"].invoke
else
# FYI: Standard & appraisal requires each a spawn process.

# FYI: Standard requires a spawn process.
# Otherwise it may be tainted by the rubocop task and
# report offenses from other plugins putted in .rubocop_todo.yml
# https://github.com/testdouble/standard/issues/480
fail unless system "bundle exec rake standard"
# Additional tasks won't run after appraisal because of
# something to do with the exit code.
# https://github.com/thoughtbot/appraisal/issues/144

# Otherwise it may be tainted by the rubocop task and
# report offenses from other plugins putted in .rubocop_todo.yml
# https://github.com/testdouble/standard/issues/480

fail unless system "bundle exec appraisal rspec"
fail unless system "bundle exec rubocop"
fail unless system "bundle exec rake standard"
end
end
2 changes: 1 addition & 1 deletion activejob-status.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "rubocop-rspec"
s.add_development_dependency "rubocop-performance"
s.add_development_dependency "simplecov"
s.add_development_dependency "standard"
s.add_development_dependency "standard", ">= 1.0"
s.add_development_dependency "timecop"
end

0 comments on commit a63b970

Please sign in to comment.