minitest-reporters 1.2.0 → 1.3.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b02ea2c94353ac48a03762e30aaa3cfd9327ea56
4
- data.tar.gz: 45a2fa6569b002324641fb00a0d2ff4f8859fd27
3
+ metadata.gz: 1de64f24b2d2599ad34866e7190a03a8cb9478fa
4
+ data.tar.gz: 2c15dca4e214acd895fa433a092f222d78c2eb16
5
5
  SHA512:
6
- metadata.gz: c324f494dce711013e7d2374664b5fae3813e3831bab9590b7b4c143a7b714f8f74d5f702dfd4890ea790c5f28594c10adbaf932f74839a0255a96675e819b01
7
- data.tar.gz: 249f3782933393949627f5978dc9c1b4900605fa3f8d4292195afc63507a99baef353acf0814b3ac229050e4faa3187ffac7326eae8becd6254271af90931a4e
6
+ metadata.gz: bfc3f4b6f73ed06be481cb192bc422fb62e5c9f119f9488f4a1c6eb251c0e549fae1229575791014bf93f6707fe0ad89ddd1dac2f7512c6e35af5d757112cd34
7
+ data.tar.gz: 035ef93686b3628cebaf5d67a056171fa7cee040ccde4194cc0bdf18c031d9f5fe2971bcfeffe940694f8c5df2923cd3e4bb6e8d33b2d5d091d775994c79ecf3
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ### [dev](https://github.com/kern/minitest-reporters/compare/v1.2.0...master)
1
+ ### [dev](https://github.com/kern/minitest-reporters/compare/v1.3.0.beta1...master)
2
+
3
+ ### [1.3.0.beta1](https://github.com/kern/minitest-reporters/compare/v1.2.0...1.3.0.beta1)
4
+
5
+ * 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))
2
6
 
3
7
  ### [1.2.0](https://github.com/kern/minitest-reporters/compare/v1.2.0.beta3...v1.2.0)
4
8
 
data/README.md CHANGED
@@ -36,6 +36,25 @@ Want to use multiple reporters?
36
36
  Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new, Minitest::Reporters::JUnitReporter.new]
37
37
  ```
38
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
+
39
58
  The following reporters are provided:
40
59
 
41
60
  ```ruby
@@ -59,7 +59,9 @@ module Minitest
59
59
  end
60
60
 
61
61
  def self.choose_reporters(console_reporters, env)
62
- if env["TM_PID"]
62
+ if env["MINITEST_REPORTER"]
63
+ [Minitest::Reporters.const_get(env["MINITEST_REPORTER"]).new]
64
+ elsif env["TM_PID"]
63
65
  [RubyMateReporter.new]
64
66
  elsif env["RM_INFO"] || env["TEAMCITY_VERSION"]
65
67
  [RubyMineReporter.new]
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Reporters
3
- VERSION = '1.2.0'
3
+ VERSION = '1.3.0.beta1'
4
4
  end
5
5
  end
@@ -31,6 +31,19 @@ module MinitestReportersTest
31
31
  assert_nil reporters
32
32
  end
33
33
 
34
+ def test_chooses_given_reporter_when_MINITEST_REPORTERS_env_set
35
+ env = {
36
+ "MINITEST_REPORTER" => "JUnitReporter",
37
+ "RM_INFO" => "x",
38
+ "TEAMCITY_VERSION" => "x",
39
+ "TM_PID" => "x" }
40
+ # JUnit reporter init has stdout messages... capture them to keep test output clean
41
+ $stdout.stub :puts, nil do
42
+ reporters = Minitest::Reporters.choose_reporters [], env
43
+ assert_instance_of Minitest::Reporters::JUnitReporter, reporters[0]
44
+ end
45
+ end
46
+
34
47
  def test_uses_minitest_clock_time_when_minitest_version_greater_than_561
35
48
  Minitest::Reporters.stub :minitest_version, 583 do
36
49
  Minitest.stub :clock_time, 6765.378751009 do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-reporters
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kern
@@ -164,9 +164,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
164
  version: 1.9.3
165
165
  required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - ">="
167
+ - - ">"
168
168
  - !ruby/object:Gem::Version
169
- version: '0'
169
+ version: 1.3.1
170
170
  requirements: []
171
171
  rubyforge_project: minitest-reporters
172
172
  rubygems_version: 2.5.2.1