Skip to content

Commit

Permalink
Tidy up the README and remove references to Rake (#23)
Browse files Browse the repository at this point in the history
* Tweak icon placement in TOC

* Remove Rake recommendations for now

* Use minitest-snapshots as an example of add'l options
  • Loading branch information
mattbrictson authored Feb 28, 2024
1 parent 2ba2a19 commit 7e97e84
Showing 1 changed file with 9 additions and 32 deletions.
41 changes: 9 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ mighty_test (`mt`) is a TDD-friendly Minitest runner for Ruby projects. It inclu

**Features**

- [⚙️ CI Mode](#%EF%B8%8F-ci-mode)
- [🧑‍🔬 Watch Mode](#-watch-mode)
- [🔬 Focus Mode](#-focus-mode)
- [🛑 Fail Fast](#-fail-fast)
- [🚥 Color Output](#-color-output)
- [💬 More Options](#-more-options)
- ⚙️ [CI Mode](#%EF%B8%8F-ci-mode)
- 🧑‍🔬 [Watch Mode](#-watch-mode)
- 🔬 [Focus Mode](#-focus-mode)
- 🛑 [Fail Fast](#-fail-fast)
- 🚥 [Color Output](#-color-output)
- 💬 [More Options](#-more-options)

**Community**

Expand Down Expand Up @@ -50,26 +50,6 @@ Now you can run mighty_test with `bin/mt`.
> [!TIP]
> **When installing mighty_test in a Rails project, make sure to put the gem in the `:test` Gemfile group.** Although Rails has a built-in test runner (`bin/rails test`) that already provides a lot of what mighty_test offers, you can still use `bin/mt` with Rails projects for its unique `--watch` mode and CI `--shard` feature.
## Rake Integration (Non-Rails)

For non-Rails projects, `rake test` is the popular convention for running tests. To provide an easy migration path to `mt`, you can make the following change to your Rakefile.

First, remove any existing `Rake::TestTask` from your Rakefile. Then add the following snippet:

```ruby
require "shellwords"

desc "Run all tests, excluding slow tests"
task :test do
sh "bin/mt", *Shellwords.split(ENV["TESTOPTS"] || ""), "--", *Array(ENV["TEST"]),
end

desc "Run all tests, slow tests included"
task :"test:all" do
sh "bin/mt", "--all", *Shellwords.split(ENV["TESTOPTS"] || "")
end
```

## Requirements

mighty_test requires modern versions of Minitest and Ruby.
Expand Down Expand Up @@ -253,14 +233,11 @@ bin/mt --verbose
bin/mt --help
```

When using the Rake integration, Rake-style test environment variables still work. These are equivalent:
If you have Minitest extensions installed, like [minitest-snapshots](https://github.com/mattbrictson/minitest-snapshots), the command line options of those extensions are supported as well.

```sh
# Rake style
rake test TEST=test/commands/init_test.rb TESTOPTS=--verbose
# CLI style
bin/mt --verbose test/commands/init_test.rb
# Update snapshots
bin/mt -u
```

## Support
Expand Down

0 comments on commit 7e97e84

Please sign in to comment.