Commit 7ce4e15
authored
fix(ruby): Use
Given this Ruby file:
```ruby
require "test_helper"
class CategoryTest < ActiveSupport::TestCase
context "validations" do
should validate_presence_of(:name)
should validate_length_of(:name).is_at_most(255)
should validate_uniqueness_of(:name)
should validate_presence_of(:slug)
should validate_length_of(:slug).is_at_most(255)
should validate_uniqueness_of(:slug)
end
end
```
Attempting to run test called `"validations"` results in the following
output:
```
# Running:
......
Finished in 0.196336s, 30.5599 runs/s, 30.5599 assertions/s.
6 runs, 6 assertions, 0 failures, 0 errors, 0 skips
⏵ Task `test test/models/category_test.rb -n ""validations""` finished successfully
⏵ Command: /opt/homebrew/bin/fish -i -c 'bin/rails'
```
With this fix:
```
# Running:
......
Finished in 0.212972s, 28.1727 runs/s, 28.1727 assertions/s.
6 runs, 6 assertions, 0 failures, 0 errors, 0 skips
⏵ Task `test test/models/category_test.rb -n "validations"` finished successfully
⏵ Command: /opt/homebrew/bin/fish -i -c 'bin/rails'
```
No changes but capturing the test name as a string without quotes gives
more control over tests that, for example, use regular expressions in
their names.
Closes #222string_content capture for Ruby test name extraction (#229)1 parent 07b1c95 commit 7ce4e15
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | | - | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
0 commit comments