| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Ref: http://docs.seattlerb.org/minitest/Minitest/Result.html#attribute-i-klass
|
|
|
|
|
| |
`filtered_results` returns an instance of `Minitest::Result` since https://github.com/seattlerb/minitest/commit/00433fc0a4fdd0e6b302aace633384ba13122376
`Minitest::Result` is not test class. So cannot get location directly.
|
| |
|
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow a default value to be declared for class_attribute
* Convert to using class_attribute default rather than explicit setter
* Removed instance_accessor option by mistake
* False is a valid default value
* Documentation
|
|
|
|
|
|
|
|
|
| |
A few have been left for aesthetic reasons, but have made a pass
and removed most of them.
Note that if the method `foo` returns an array, `foo << 1`
is a regular push, nothing to do with assignments, so
no self required.
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
| |
The process of converting `Test` to `String` is already defined in minitest.
I think it is better to use that for the consistency of output content.
ref: https://github.com/seattlerb/minitest/blob/master/lib/minitest/test.rb#L261..L267
|
| |
|
|
|
|
|
| |
This is a follow-up to ea70c29 to bring back the assertion error
location information provided by minitest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 0db310586ac3e15be95d2ef27ff40cfa24c05c10.
Closes #23686.
Conflicts:
railties/test/application/test_runner_test.rb
It's possible that the `result.location` returned by minitest is outside
the test file itself. For example in the case of mocha. This resulted in
bad rerun snipptets:
```
bin/rails test app/models/deliveries/delivery.rb:103
```
Let's always use the first line of the failed test-case in our rerun
snippet. We can display the line number of the assertion error elsewhere.
|
|
|
|
|
|
|
|
|
|
|
| |
Didn't like the constant being at the top of the file, gave it overdue importance.
Now that `color_output` expects a result we can shorten some of the flexibility
from earlier:
* Inline COLOR_CODES constant (keep local variable for readability,
but don't need names of colors at run time).
* Inline color variable in `color_output`. Looks just as clear without it.
|
|
|
|
|
| |
Focus `color_output`'s intent on coloring output by a result. We aren't meant
to pass it arbitrary codes to color output.
|
|
|
|
|
|
| |
The word color is being thrown all around with slightly different meanings.
Right now, I understand it. But I'd like to be more immediately clear.
|
|
|
|
| |
I got the blues because we aren't coloring any lines blue.
|
|
|
|
|
|
|
| |
The static red color wouldn't paint skips in their designated yellow.
Use the color name we got from the result label earlier, which marks
skips as yellow.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The errors message only was not displayed, as if it did not use the inline reporting,
modified to also information the method name and the like in error are displayed.
```
# before
Failed assertion, no message given.
bin/rails test test/models/user_test.rb:5
```
```
# after
Failure:
UserTest#test_the_truth:
Failed assertion, no message given.
bin/rails test test/models/user_test.rb:5
```
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the absolute path is not required to re-run the test,
modified so that unnecessary information is not displayed.
```ruby
# before
bin/rails test /path/to/blorgh/test/integration/navigation_test.rb:5
# after
bin/rails test test/integration/navigation_test.rb:5
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running tests, the Rails test runner would report the start of the test method as the test failure.
For this test:
```ruby
1 require 'test_helper
2
3 class BunnyTest < ActiveSupport::TestCase
4 test "something failing" do
5 assert false, 'This failed'
6 end
7 end
```
The runner outputs 5 instead of 4:
```
............................................F
This failed
bin/rails test test/models/bunny_test.rb:5
........
```
|
|
|
|
|
|
| |
Change the reporter to just read the option.
Pass output_inline where needed in tests.
|
|
|
|
|
| |
Passing `--fail-fast` to the test runner will now abort the test run
on the first failure. The run continues on any unexpected errors.
|
|
|
|
|
|
|
|
|
| |
Any failures or errors will be reported inline during the run by default.
Skipped tests will be reported if run in verbose mode.
Any result is output with failure messages and a rerun snippet for that test.
Rerun snippets won't be output after a run, unless `--defer-output` is passed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the Rails repository we use a `bin/test` executable to run our tests.
However the rerun snippets still included `bin/rails test`:
BEFORE:
```
Failed tests:
bin/rails test test/cases/adapters/postgresql/schema_test.rb:91
```
AFTER:
```
Failed tests:
bin/test test/cases/adapters/postgresql/schema_test.rb:91
```
|
|
|
|
|
|
|
|
|
|
|
| |
This also adds free mix and matching of directories, files and lines filters.
Like so:
bin/rails test models/post_test.rb test/integration models/person_test.rb:26
You can also mix in a traditional Minitest filter:
bin/rails test test/integration -n /check_it_out/
|
| |
|
| |
|
| |
|
| |
|
|
|