Skip to content

Commit

Permalink
Annotate languages in code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
matt17r committed Nov 9, 2023
1 parent 381fbe3 commit f016fc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guides/source/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ Known extensions: rails, pride

The `--name` (`-n`) and `--exclude` options can be used to filter (include or exclude) tests based on the test name, not the file name. Test names are derived from the standard Ruby nomenclature of Class::Module::method. To name the tests, the Minitest DSL replaces `::` with `#` and converts test names to methods using snake_case and the prefix `test_` (preserving case). For example:

```
```ruby
# test/models/bookmark_test.rb
require "test_helper"

Expand All @@ -497,13 +497,13 @@ The above code will generate the ruby method `BookmarkTest::test_should_not_save

In a Rails app you can run all tests that are in classes starting with the name "Post" (e.g. PostsControllerTest in controllers, PostTest in models and PostsTest in system) using:

```
```bash
$ bin/rails test --name /^Post/
```

To exclude any test in any file that contains the exact word "user", even if it's the last word, use:

```
```bash
$ bin/rails test --exclude /_user(_|$)/
```

Expand Down

0 comments on commit f016fc0

Please sign in to comment.