minitest-reporters 1.3.0 → 1.3.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +27 -27
  3. data/.ruby-gemset +1 -1
  4. data/.travis.yml +10 -10
  5. data/.yardopts +5 -5
  6. data/CHANGELOG.md +58 -54
  7. data/Gemfile +2 -2
  8. data/LICENSE +19 -19
  9. data/README.md +134 -134
  10. data/Rakefile +60 -60
  11. data/lib/minitest/extensible_backtrace_filter.rb +67 -67
  12. data/lib/minitest/minitest_reporter_plugin.rb +75 -75
  13. data/lib/minitest/old_activesupport_fix.rb +24 -24
  14. data/lib/minitest/relative_position.rb +26 -26
  15. data/lib/minitest/reporters.rb +91 -91
  16. data/lib/minitest/reporters/ansi.rb +31 -31
  17. data/lib/minitest/reporters/base_reporter.rb +119 -117
  18. data/lib/minitest/reporters/default_reporter.rb +228 -228
  19. data/lib/minitest/reporters/html_reporter.rb +221 -221
  20. data/lib/minitest/reporters/junit_reporter.rb +158 -158
  21. data/lib/minitest/reporters/mean_time_reporter.rb +392 -392
  22. data/lib/minitest/reporters/progress_reporter.rb +96 -96
  23. data/lib/minitest/reporters/ruby_mate_reporter.rb +54 -54
  24. data/lib/minitest/reporters/rubymine_reporter.rb +117 -117
  25. data/lib/minitest/reporters/spec_reporter.rb +61 -61
  26. data/lib/minitest/reporters/version.rb +5 -5
  27. data/lib/minitest/templates/index.html.erb +82 -82
  28. data/minitest-reporters.gemspec +31 -31
  29. data/test/fixtures/junit_filename_bug_example_test.rb +21 -21
  30. data/test/fixtures/mean_time_test.rb +8 -8
  31. data/test/fixtures/progress_detailed_skip_test.rb +8 -8
  32. data/test/fixtures/progress_test.rb +8 -8
  33. data/test/fixtures/sample_test.rb +15 -15
  34. data/test/fixtures/spec_test.rb +13 -13
  35. data/test/gallery/bad_test.rb +25 -25
  36. data/test/gallery/good_test.rb +14 -14
  37. data/test/integration/reporters/junit_reporter_test.rb +12 -12
  38. data/test/integration/reporters/mean_time_reporter_test.rb +7 -7
  39. data/test/integration/reporters/progress_reporter_test.rb +34 -34
  40. data/test/test_helper.rb +22 -22
  41. data/test/unit/minitest/extensible_backtrace_filter_test.rb +42 -42
  42. data/test/unit/minitest/mean_time_reporter_unit_test.rb +152 -152
  43. data/test/unit/minitest/minitest_reporter_plugin_test.rb +14 -14
  44. data/test/unit/minitest/reporters_test.rb +65 -65
  45. data/test/unit/minitest/spec_reporter_test.rb +41 -41
  46. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21bded15362c7a4d4bd725d336147ccc0d29a99bc380b145bc6649ee791493d8
4
- data.tar.gz: daa8ca083c60aca04d34b11033db590689a9a69b903afb9443af6fd32525dfd9
3
+ metadata.gz: 788aa29ec21d6b7a24eb386a8ace48c887f49ed39e703796cf760a936d5e3cc6
4
+ data.tar.gz: fbf89070533db2a278b96a5c7e3012505454e66d8302513f67d1919cef490300
5
5
  SHA512:
6
- metadata.gz: 80a0586f10089a74b664a2241e7e26d6814cb6cf229477b8bf9c89a28d86ee3d1bdfdac990997ba39b9519c55814fbb767c7ce9bb4cd7c071483decfd8dce226
7
- data.tar.gz: f2fe812eafbb7825c3dfadce97bcf2f4a71a2315e5001309ab6e44675c97b93e9602712aeaa65fd25c3de2498882fb925d2ca8518ecca941a52ec1eab7e2b979
6
+ metadata.gz: f9aab7234577b2f365c4b4f4f669be27fbb2e5290c06a5b89a01fff26d4064c0b5efeb65af0fcd8f91b498a589019456774e4dc88117cfb0b5bd401d76dde6d2
7
+ data.tar.gz: ab4dc1caf3409ad1ce542a99de5acf84448a3f468eeea96c1d063e07122a9f5f4a36c38bf74f1c64f889939cfdb648cacfb3cc9146462e7fecfcc24c7b2788d9
data/.gitignore CHANGED
@@ -1,27 +1,27 @@
1
- coverage
2
- rdoc
3
- pkg
4
- test/tmp
5
- test/version_tmp
6
- test/reports
7
- test/html_reports
8
- tmp
9
- pkg
10
- *.gem
11
- *.rbc
12
- lib/bundler/man
13
- spec/reports
14
- .config
15
- InstalledFiles
16
- .bundle
17
-
18
- # YARD artifacts
19
- .yardoc
20
- _yardoc
21
- doc/
22
-
23
- # Gem-specific
24
- Gemfile.lock
25
- .idea/
26
- .ruby-version
27
-
1
+ coverage
2
+ rdoc
3
+ pkg
4
+ test/tmp
5
+ test/version_tmp
6
+ test/reports
7
+ test/html_reports
8
+ tmp
9
+ pkg
10
+ *.gem
11
+ *.rbc
12
+ lib/bundler/man
13
+ spec/reports
14
+ .config
15
+ InstalledFiles
16
+ .bundle
17
+
18
+ # YARD artifacts
19
+ .yardoc
20
+ _yardoc
21
+ doc/
22
+
23
+ # Gem-specific
24
+ Gemfile.lock
25
+ .idea/
26
+ .ruby-version
27
+
data/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- minitest-reporters
1
+ minitest-reporters
data/.travis.yml CHANGED
@@ -1,10 +1,10 @@
1
- script: 'rake test'
2
- before_install:
3
- - gem install bundler
4
- rvm:
5
- - 2.3.0
6
- - 2.2
7
- - 2.1
8
- - 2.0.0
9
- - 1.9.3
10
- - jruby-9.1.9.0
1
+ script: 'rake test'
2
+ before_install:
3
+ - gem install bundler
4
+ rvm:
5
+ - 2.3.0
6
+ - 2.2
7
+ - 2.1
8
+ - 2.0.0
9
+ - 1.9.3
10
+ - jruby-9.1.9.0
data/.yardopts CHANGED
@@ -1,6 +1,6 @@
1
- --readme README.md
2
- --markup markdown
3
- --markup-provider maruku
4
- --default-return ""
5
- --title "Minitest-reporters Documentation"
1
+ --readme README.md
2
+ --markup markdown
3
+ --markup-provider maruku
4
+ --default-return ""
5
+ --title "Minitest-reporters Documentation"
6
6
  --hide-void-return
data/CHANGELOG.md CHANGED
@@ -1,54 +1,58 @@
1
- ### [dev](https://github.com/kern/minitest-reporters/compare/v1.3.0...master)
2
-
3
- ### [v1.3.0](https://github.com/kern/minitest-reporters/compare/v1.3.0.beta3...v1.3.0)
4
-
5
- ### [v1.3.0.beta3](https://github.com/kern/minitest-reporters/compare/v1.3.0.beta2...v1.3.0.beta3)
6
-
7
- * [#261](https://github.com/kern/minitest-reporters/issues/261) fixed by [#262](https://github.com/kern/minitest-reporters/pull/262) contributed by [trabulmonkee](https://github.com/trabulmonkee)
8
-
9
- ### [1.3.0.beta2](https://github.com/kern/minitest-reporters/compare/v1.3.0.beta1...v1.3.0.beta2)
10
-
11
- * JUnit reporter fixed to comply with JUnit spec ([#257](https://github.com/kern/minitest-reporters/issues/257), [#260](https://github.com/kern/minitest-reporters/pull/260) contributed by [brettwgreen](https://github.com/brettwgreen))
12
-
13
- ### [1.3.0.beta1](https://github.com/kern/minitest-reporters/compare/v1.2.0...v1.3.0.beta1)
14
-
15
- * MINITEST_REPORTER env variable can be used to override reporter [#256](https://github.com/kern/minitest-reporters/pull/256) (contributed by [brettwgreen](https://github.com/brettwgreen))
16
-
17
- ### [1.2.0](https://github.com/kern/minitest-reporters/compare/v1.2.0.beta3...v1.2.0)
18
-
19
- ### [1.2.0.beta3](https://github.com/kern/minitest-reporters/compare/v1.2.0.beta2...v1.2.0.beta3)
20
-
21
- * junit reporter changed to support mintest >= 5.11 [#252](https://github.com/kern/minitest-reporters/pull/252) (contributed by [Kevinrob](https://github.com/Kevinrob))
22
- * all reporters changed to be compatible with minitest >= 5.11 (if not - report a bug ;)
23
-
24
- ### [1.2.0.beta2](https://github.com/kern/minitest-reporters/compare/v1.2.0.beta1...v1.2.0.beta2)
25
-
26
- * fixed uninitialized time in junit reporter [#251](https://github.com/kern/minitest-reporters/issues/251)
27
- * format option added to progress reporter [#240](https://github.com/kern/minitest-reporters/pull/240) (contributed by [jorgesmu](https://github.com/jorgesmu))
28
- * improved output of junit reporter [#245](https://github.com/kern/minitest-reporters/pull/245) (contributed by [jules2689](https://github.com/jules2689))
29
-
30
- ### [1.2.0.beta1](https://github.com/kern/minitest-reporters/compare/v1.1.19...v1.2.0.beta1)
31
-
32
- * SpecReporter regression for Minitest 5.11.1 fixed [#250](https://github.com/kern/minitest-reporters/pull/250) (contrinuted by [mbround18](https://github.com/mbround18))
33
-
34
- ### [1.1.19](https://github.com/kern/minitest-reporters/compare/v1.1.18...v1.1.19)
35
-
36
- * Reverted [#236](https://github.com/kern/minitest-reporters/pull/236) (it creates too many problems)
37
-
38
- ### [1.1.18](https://github.com/kern/minitest-reporters/compare/v1.1.17...v1.1.18)
39
-
40
- * Fixed problem with Rails 5.1.3 [#230](https://github.com/kern/minitest-reporters/issues/230) by [#236](https://github.com/kern/minitest-reporters/pull/236) (contributed by [samcday](https://github.com/samcday))
41
-
42
- ### [1.1.17](https://github.com/kern/minitest-reporters/compare/v1.1.16...v1.1.17)
43
-
44
- * Fixed tests' counting [#232](https://github.com/kern/minitest-reporters/pull/232) (contributed by [adaedra](https://github.com/adaedra))
45
-
46
- ### [1.1.16](https://github.com/kern/minitest-reporters/compare/v1.1.15...v1.1.16)
47
-
48
- * reverted fix for [#231](https://github.com/kern/minitest-reporters/pull/231) to fix[#233](https://github.com/kern/minitest-reporters/pull/233)
49
-
50
- ## [1.1.15](https://github.com/kern/minitest-reporters/compare/v1.1.14...v1.1.15)
51
-
52
- * Fixed problem with handling SIGINFO [#231](https://github.com/kern/minitest-reporters/pull/231) (contributed by [joshpencheon](https://github.com/joshpencheon))
53
-
54
-
1
+ ### [dev](https://github.com/kern/minitest-reporters/compare/v1.3.1.beta1...master)
2
+
3
+ ### [v1.3.1.beta1](https://github.com/kern/minitest-reporters/compare/v1.3.0...v1.3.1.beta1)
4
+
5
+ * Fixed time reporting [#265](https://github.com/kern/minitest-reporters/pull/265) contributed by [brendandeere](https://github.com/brendandeere)
6
+
7
+ ### [v1.3.0](https://github.com/kern/minitest-reporters/compare/v1.3.0.beta3...v1.3.0)
8
+
9
+ ### [v1.3.0.beta3](https://github.com/kern/minitest-reporters/compare/v1.3.0.beta2...v1.3.0.beta3)
10
+
11
+ * [#261](https://github.com/kern/minitest-reporters/issues/261) fixed by [#262](https://github.com/kern/minitest-reporters/pull/262) contributed by [trabulmonkee](https://github.com/trabulmonkee)
12
+
13
+ ### [1.3.0.beta2](https://github.com/kern/minitest-reporters/compare/v1.3.0.beta1...v1.3.0.beta2)
14
+
15
+ * JUnit reporter fixed to comply with JUnit spec ([#257](https://github.com/kern/minitest-reporters/issues/257), [#260](https://github.com/kern/minitest-reporters/pull/260) contributed by [brettwgreen](https://github.com/brettwgreen))
16
+
17
+ ### [1.3.0.beta1](https://github.com/kern/minitest-reporters/compare/v1.2.0...v1.3.0.beta1)
18
+
19
+ * MINITEST_REPORTER env variable can be used to override reporter [#256](https://github.com/kern/minitest-reporters/pull/256) (contributed by [brettwgreen](https://github.com/brettwgreen))
20
+
21
+ ### [1.2.0](https://github.com/kern/minitest-reporters/compare/v1.2.0.beta3...v1.2.0)
22
+
23
+ ### [1.2.0.beta3](https://github.com/kern/minitest-reporters/compare/v1.2.0.beta2...v1.2.0.beta3)
24
+
25
+ * junit reporter changed to support mintest >= 5.11 [#252](https://github.com/kern/minitest-reporters/pull/252) (contributed by [Kevinrob](https://github.com/Kevinrob))
26
+ * all reporters changed to be compatible with minitest >= 5.11 (if not - report a bug ;)
27
+
28
+ ### [1.2.0.beta2](https://github.com/kern/minitest-reporters/compare/v1.2.0.beta1...v1.2.0.beta2)
29
+
30
+ * fixed uninitialized time in junit reporter [#251](https://github.com/kern/minitest-reporters/issues/251)
31
+ * format option added to progress reporter [#240](https://github.com/kern/minitest-reporters/pull/240) (contributed by [jorgesmu](https://github.com/jorgesmu))
32
+ * improved output of junit reporter [#245](https://github.com/kern/minitest-reporters/pull/245) (contributed by [jules2689](https://github.com/jules2689))
33
+
34
+ ### [1.2.0.beta1](https://github.com/kern/minitest-reporters/compare/v1.1.19...v1.2.0.beta1)
35
+
36
+ * SpecReporter regression for Minitest 5.11.1 fixed [#250](https://github.com/kern/minitest-reporters/pull/250) (contrinuted by [mbround18](https://github.com/mbround18))
37
+
38
+ ### [1.1.19](https://github.com/kern/minitest-reporters/compare/v1.1.18...v1.1.19)
39
+
40
+ * Reverted [#236](https://github.com/kern/minitest-reporters/pull/236) (it creates too many problems)
41
+
42
+ ### [1.1.18](https://github.com/kern/minitest-reporters/compare/v1.1.17...v1.1.18)
43
+
44
+ * Fixed problem with Rails 5.1.3 [#230](https://github.com/kern/minitest-reporters/issues/230) by [#236](https://github.com/kern/minitest-reporters/pull/236) (contributed by [samcday](https://github.com/samcday))
45
+
46
+ ### [1.1.17](https://github.com/kern/minitest-reporters/compare/v1.1.16...v1.1.17)
47
+
48
+ * Fixed tests' counting [#232](https://github.com/kern/minitest-reporters/pull/232) (contributed by [adaedra](https://github.com/adaedra))
49
+
50
+ ### [1.1.16](https://github.com/kern/minitest-reporters/compare/v1.1.15...v1.1.16)
51
+
52
+ * reverted fix for [#231](https://github.com/kern/minitest-reporters/pull/231) to fix[#233](https://github.com/kern/minitest-reporters/pull/233)
53
+
54
+ ## [1.1.15](https://github.com/kern/minitest-reporters/compare/v1.1.14...v1.1.15)
55
+
56
+ * Fixed problem with handling SIGINFO [#231](https://github.com/kern/minitest-reporters/pull/231) (contributed by [joshpencheon](https://github.com/joshpencheon))
57
+
58
+
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
- source "https://rubygems.org"
2
- gemspec
1
+ source "https://rubygems.org"
2
+ gemspec
data/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright (c) 2011 Alexander Kern
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1
+ Copyright (c) 2011 Alexander Kern
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,134 +1,134 @@
1
- [gem]: https://rubygems.org/gems/minitest-reporters
2
- [travis]: https://travis-ci.org/kern/minitest-reporters
3
-
4
- # minitest-reporters - create customizable Minitest output formats
5
-
6
- [![Join the chat at https://gitter.im/kern/minitest-reporters](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kern/minitest-reporters?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7
- [![Gem Version](https://badge.fury.io/rb/minitest-reporters.svg)][gem]
8
- [![Build Status](https://secure.travis-ci.org/kern/minitest-reporters.png)][travis]
9
-
10
- Death to haphazard monkey-patching! Extend Minitest through simple hooks.
11
-
12
- ## Installation ##
13
-
14
- gem install minitest-reporters
15
-
16
- ## Usage ##
17
-
18
- In your `test_helper.rb` file, add the following lines:
19
-
20
- ```ruby
21
- require "minitest/reporters"
22
- Minitest::Reporters.use!
23
- ```
24
-
25
- This will swap out the Minitest runner to the custom one used by minitest-reporters and use the correct reporters for Textmate, Rubymine, and the console. If you would like to write your own reporter, just `include Minitest::Reporter` and override the methods you'd like. Take a look at the provided reporters for examples.
26
-
27
- Don't like the default progress bar reporter?
28
-
29
- ```ruby
30
- Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
31
- ```
32
-
33
- Want to use multiple reporters?
34
-
35
- ```ruby
36
- Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new, Minitest::Reporters::JUnitReporter.new]
37
- ```
38
-
39
- If RubyMate, TeamCity, RubyMine or VIM presence is detected, the reporter will be automatically chosen,
40
- regardless of any reporters passed to the `use!` method.
41
-
42
- To override this behavior, you may set the ENV variable MINITEST_REPORTER:
43
-
44
- ```sh
45
- export MINITEST_REPORTER=JUnitReporter
46
- ```
47
-
48
- Detection of those systems is based on presence of certain ENV variables and are evaulated in the following order:
49
-
50
- ```
51
- MINITEST_REPORTER => use reporter indicated in env variable
52
- TM_PID => use RubyMateReporter
53
- RM_INFO => use RubyMineReporter
54
- TEAMCITY_VERSION => use RubyMineReporter
55
- VIM => disable all Reporters
56
- ```
57
-
58
- The following reporters are provided:
59
-
60
- ```ruby
61
- Minitest::Reporters::DefaultReporter # => Redgreen-capable version of standard Minitest reporter
62
- Minitest::Reporters::SpecReporter # => Turn-like output that reads like a spec
63
- Minitest::Reporters::ProgressReporter # => Fuubar-like output with a progress bar
64
- Minitest::Reporters::RubyMateReporter # => Simple reporter designed for RubyMate
65
- Minitest::Reporters::RubyMineReporter # => Reporter designed for RubyMine IDE and TeamCity CI server
66
- Minitest::Reporters::JUnitReporter # => JUnit test reporter designed for JetBrains TeamCity
67
- Minitest::Reporters::MeanTimeReporter # => Produces a report summary showing the slowest running tests
68
- Minitest::Reporters::HtmlReporter # => Generates an HTML report of the test results
69
- ```
70
-
71
- Options can be passed to these reporters at construction-time, e.g. to force
72
- color output from `DefaultReporter`:
73
-
74
- ```ruby
75
- Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
76
- ```
77
-
78
- ## Screenshots ##
79
-
80
- **Default Reporter**
81
-
82
- ![Default Reporter](./assets/default-reporter.png?raw=true)
83
-
84
- **Spec Reporter**
85
-
86
- ![Spec Reporter](./assets/spec-reporter.png?raw=true)
87
-
88
- **Progress Reporter**
89
-
90
- ![Progress Reporter](./assets/progress-reporter.png?raw=true)
91
-
92
- ## Caveats ##
93
-
94
- If you are using minitest-reporters with ActiveSupport 3.x, make sure that you require ActiveSupport before invoking `Minitest::Reporters.use!`. Minitest-reporters fixes incompatibilities caused by monkey patches in ActiveSupport 3.x. ActiveSupport 4.x is unaffected.
95
-
96
- **Rails Backtrace Filtering and Custom Backtrace Filtering**
97
-
98
- Minitest lets you configures your own, custom backtrace filter via
99
- `Minitest.backtrace_filter=`. If you're using Rails, then by default
100
- `Minitest.backtrace_filter` is a filter designed specially for Rails.
101
-
102
- But minitest-reporters overwrites `Minitest.backtrace_filter` by default. That means it
103
- will overwrite your custom filter and Rails' default filter. (You'll know this is
104
- happening if you see overly long or otherwise unexpected backtraces.)
105
-
106
- To avoid that, you must manually tell minitest-reporters which filter to use. In Rails,
107
- do this in `test_helper.rb`:
108
-
109
- Minitest::Reporters.use!(
110
- Minitest::Reporters::DefaultReporter.new,
111
- ENV,
112
- Minitest.backtrace_filter
113
- )
114
-
115
- The third parameter to `.use!`, in this case `Minitest.backtrace_filter`, should be a
116
- filter object. In the above example, you're telling minitest-reporters to use the filter
117
- that Rails has already set.
118
-
119
- ## Note on Patches/Pull Requests ##
120
-
121
- * Fork the project.
122
- * Make your feature addition or bug fix.
123
- * Add tests for it. This is important so I don't break it in a future version unintentionally.
124
- * Commit, but do not mess with the `Rakefile`. If you want to have your own version, that is fine but bump the version in a commit by itself in another branch so I can ignore it when I pull.
125
- * Send me a pull request. Bonus points for git flow feature branches.
126
-
127
- ## Resources ##
128
-
129
- * [GitHub Repository](https://github.com/CapnKernul/minitest-reporters)
130
- * [Documentation](http://www.rubydoc.info/github/kern/minitest-reporters/master)
131
-
132
- ## License ##
133
-
134
- Minitest-reporters is licensed under the MIT License. See `LICENSE` for details.
1
+ [gem]: https://rubygems.org/gems/minitest-reporters
2
+ [travis]: https://travis-ci.org/kern/minitest-reporters
3
+
4
+ # minitest-reporters - create customizable Minitest output formats
5
+
6
+ [![Join the chat at https://gitter.im/kern/minitest-reporters](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kern/minitest-reporters?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7
+ [![Gem Version](https://badge.fury.io/rb/minitest-reporters.svg)][gem]
8
+ [![Build Status](https://secure.travis-ci.org/kern/minitest-reporters.png)][travis]
9
+
10
+ Death to haphazard monkey-patching! Extend Minitest through simple hooks.
11
+
12
+ ## Installation ##
13
+
14
+ gem install minitest-reporters
15
+
16
+ ## Usage ##
17
+
18
+ In your `test_helper.rb` file, add the following lines:
19
+
20
+ ```ruby
21
+ require "minitest/reporters"
22
+ Minitest::Reporters.use!
23
+ ```
24
+
25
+ This will swap out the Minitest runner to the custom one used by minitest-reporters and use the correct reporters for Textmate, Rubymine, and the console. If you would like to write your own reporter, just `include Minitest::Reporter` and override the methods you'd like. Take a look at the provided reporters for examples.
26
+
27
+ Don't like the default progress bar reporter?
28
+
29
+ ```ruby
30
+ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
31
+ ```
32
+
33
+ Want to use multiple reporters?
34
+
35
+ ```ruby
36
+ Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new, Minitest::Reporters::JUnitReporter.new]
37
+ ```
38
+
39
+ If RubyMate, TeamCity, RubyMine or VIM presence is detected, the reporter will be automatically chosen,
40
+ regardless of any reporters passed to the `use!` method.
41
+
42
+ To override this behavior, you may set the ENV variable MINITEST_REPORTER:
43
+
44
+ ```sh
45
+ export MINITEST_REPORTER=JUnitReporter
46
+ ```
47
+
48
+ Detection of those systems is based on presence of certain ENV variables and are evaulated in the following order:
49
+
50
+ ```
51
+ MINITEST_REPORTER => use reporter indicated in env variable
52
+ TM_PID => use RubyMateReporter
53
+ RM_INFO => use RubyMineReporter
54
+ TEAMCITY_VERSION => use RubyMineReporter
55
+ VIM => disable all Reporters
56
+ ```
57
+
58
+ The following reporters are provided:
59
+
60
+ ```ruby
61
+ Minitest::Reporters::DefaultReporter # => Redgreen-capable version of standard Minitest reporter
62
+ Minitest::Reporters::SpecReporter # => Turn-like output that reads like a spec
63
+ Minitest::Reporters::ProgressReporter # => Fuubar-like output with a progress bar
64
+ Minitest::Reporters::RubyMateReporter # => Simple reporter designed for RubyMate
65
+ Minitest::Reporters::RubyMineReporter # => Reporter designed for RubyMine IDE and TeamCity CI server
66
+ Minitest::Reporters::JUnitReporter # => JUnit test reporter designed for JetBrains TeamCity
67
+ Minitest::Reporters::MeanTimeReporter # => Produces a report summary showing the slowest running tests
68
+ Minitest::Reporters::HtmlReporter # => Generates an HTML report of the test results
69
+ ```
70
+
71
+ Options can be passed to these reporters at construction-time, e.g. to force
72
+ color output from `DefaultReporter`:
73
+
74
+ ```ruby
75
+ Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(:color => true)]
76
+ ```
77
+
78
+ ## Screenshots ##
79
+
80
+ **Default Reporter**
81
+
82
+ ![Default Reporter](./assets/default-reporter.png?raw=true)
83
+
84
+ **Spec Reporter**
85
+
86
+ ![Spec Reporter](./assets/spec-reporter.png?raw=true)
87
+
88
+ **Progress Reporter**
89
+
90
+ ![Progress Reporter](./assets/progress-reporter.png?raw=true)
91
+
92
+ ## Caveats ##
93
+
94
+ If you are using minitest-reporters with ActiveSupport 3.x, make sure that you require ActiveSupport before invoking `Minitest::Reporters.use!`. Minitest-reporters fixes incompatibilities caused by monkey patches in ActiveSupport 3.x. ActiveSupport 4.x is unaffected.
95
+
96
+ **Rails Backtrace Filtering and Custom Backtrace Filtering**
97
+
98
+ Minitest lets you configures your own, custom backtrace filter via
99
+ `Minitest.backtrace_filter=`. If you're using Rails, then by default
100
+ `Minitest.backtrace_filter` is a filter designed specially for Rails.
101
+
102
+ But minitest-reporters overwrites `Minitest.backtrace_filter` by default. That means it
103
+ will overwrite your custom filter and Rails' default filter. (You'll know this is
104
+ happening if you see overly long or otherwise unexpected backtraces.)
105
+
106
+ To avoid that, you must manually tell minitest-reporters which filter to use. In Rails,
107
+ do this in `test_helper.rb`:
108
+
109
+ Minitest::Reporters.use!(
110
+ Minitest::Reporters::DefaultReporter.new,
111
+ ENV,
112
+ Minitest.backtrace_filter
113
+ )
114
+
115
+ The third parameter to `.use!`, in this case `Minitest.backtrace_filter`, should be a
116
+ filter object. In the above example, you're telling minitest-reporters to use the filter
117
+ that Rails has already set.
118
+
119
+ ## Note on Patches/Pull Requests ##
120
+
121
+ * Fork the project.
122
+ * Make your feature addition or bug fix.
123
+ * Add tests for it. This is important so I don't break it in a future version unintentionally.
124
+ * Commit, but do not mess with the `Rakefile`. If you want to have your own version, that is fine but bump the version in a commit by itself in another branch so I can ignore it when I pull.
125
+ * Send me a pull request. Bonus points for git flow feature branches.
126
+
127
+ ## Resources ##
128
+
129
+ * [GitHub Repository](https://github.com/CapnKernul/minitest-reporters)
130
+ * [Documentation](http://www.rubydoc.info/github/kern/minitest-reporters/master)
131
+
132
+ ## License ##
133
+
134
+ Minitest-reporters is licensed under the MIT License. See `LICENSE` for details.