From f016fc090346c20e9fe296df6702127c49e64e44 Mon Sep 17 00:00:00 2001 From: Matthew Lindfield Seager Date: Thu, 9 Nov 2023 14:21:52 +1100 Subject: [PATCH] Annotate languages in code blocks --- guides/source/testing.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guides/source/testing.md b/guides/source/testing.md index a88f1393066c6..7925e16547ae5 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -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" @@ -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(_|$)/ ```