Commit Graph

23 Commits

Author SHA1 Message Date
Alberto Almagro
a7986aeda0 Show rails instead of bin/rails on USAGE instructions
With this commit, rails commands usage instructions display now +rails+
instead of +bin/rails+ within their recommendations.
2018-07-06 22:46:54 +02:00
yuuji.yaginuma
76b75ac094 Need to use klass to get the class name of the test result
Ref: http://docs.seattlerb.org/minitest/Minitest/Result.html#attribute-i-klass
2018-01-03 17:37:15 +09:00
yuuji.yaginuma
ff0d5f1450 Correctly get source location
`filtered_results` returns an instance of `Minitest::Result` since 00433fc0a4
`Minitest::Result` is not test class. So cannot get location directly.
2018-01-03 17:37:14 +09:00
Pat Allan
acea68de02 Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
Kasper Timm Hansen
0d72489b2a * Don't eagerly require Rails' minitest plugin.
By making the Rails minitest behave like a standard minitest plugin
we're much more likely to not break when people use other minitest
plugins. Like minitest-focus and pride.

To do this, we need to behave like minitest: require files up front
and then perform the plugin behavior via the at_exit hook.
This also saves us a fair bit of wrangling with test file loading.

Finally, since the environment and warnings options have to be applied
as early as possible, and since minitest loads plugins at_exit, they
have to be moved to the test command.

* Don't expect the root method.

It's likely this worked because we eagerly loaded the Rails minitest plugin
and that somehow defined a root method on `Rails`.

* Assign a backtrace to failed exceptions.

Otherwise Minitest pukes when attempting to filter the backtrace (which
Rails' backtrace cleaner then removes).

Means the exception message test has to be revised too.

This is likely caused by the rails minitest plugin now being loaded for
these tests and assigning a default backtrace cleaner.
2017-07-10 20:40:16 +02:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Ryuta Kamizono
b201474756 Should escape meta characters in regexp 2017-05-07 04:10:00 +09:00
Xavier Noria
80e66cc4d9 normalizes indentation and whitespace across the project 2016-08-06 20:16:27 +02:00
Xavier Noria
783763bde9 applies new string literal convention in railties/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:16:09 +02:00
yuuji.yaginuma
1b8fc04216 modify to error also abort when specify fail fast option 2016-02-17 22:04:32 +09:00
Yves Senn
156c2cb571 fix more failing tests due to 07e422f ... 🙏 2016-02-15 17:36:54 +01:00
Lucas Mazza
7fa3a0c90a Add colored output to the new test reporter. 2015-12-22 10:58:05 -02:00
yuuji.yaginuma
4f8c36ab70 display detailed information in inline reporting
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
```
2015-12-21 07:48:53 +09:00
Kasper Timm Hansen
49eefe123a Don't match specific line numbers in reporter tests.
The overall syntax of the file path is more important, not the exact line it was on.
2015-11-12 21:22:40 +01:00
Kasper Timm Hansen
54f3a18eec Output inline is set to true in the plugin.
Change the reporter to just read the option.

Pass output_inline where needed in tests.
2015-10-07 22:49:41 +02:00
Kasper Timm Hansen
2310fb9d81 Add fail fast to test runner.
Passing `--fail-fast` to the test runner will now abort the test run
on the first failure. The run continues on any unexpected errors.
2015-09-29 08:37:33 +02:00
Kasper Timm Hansen
64a3b09b40 Add inline failure reporting to test runner.
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.
2015-09-28 20:30:03 +02:00
yuuji.yaginuma
1d3e0f5872 do not show "Failed tests" message when a failed test is not 2015-06-23 07:53:17 +09:00
yuuji.yaginuma
3bcb637eab remove unused variable in reporter test 2015-06-22 08:04:53 +09:00
Yves Senn
2e59604909 make it possible to customize the executable inside rereun snippets.
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
```
2015-06-13 11:58:43 +02:00
Arthur Neves
f10c7e1849 Fix reporter test and verbose mode 2015-03-18 09:52:19 +01:00
Yves Senn
ff79441d49 add tests for our minitest reporter. 2015-03-18 09:52:17 +01:00