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.
- checksums.yaml +4 -4
- data/.gitignore +27 -27
- data/.ruby-gemset +1 -1
- data/.travis.yml +10 -10
- data/.yardopts +5 -5
- data/CHANGELOG.md +58 -54
- data/Gemfile +2 -2
- data/LICENSE +19 -19
- data/README.md +134 -134
- data/Rakefile +60 -60
- data/lib/minitest/extensible_backtrace_filter.rb +67 -67
- data/lib/minitest/minitest_reporter_plugin.rb +75 -75
- data/lib/minitest/old_activesupport_fix.rb +24 -24
- data/lib/minitest/relative_position.rb +26 -26
- data/lib/minitest/reporters.rb +91 -91
- data/lib/minitest/reporters/ansi.rb +31 -31
- data/lib/minitest/reporters/base_reporter.rb +119 -117
- data/lib/minitest/reporters/default_reporter.rb +228 -228
- data/lib/minitest/reporters/html_reporter.rb +221 -221
- data/lib/minitest/reporters/junit_reporter.rb +158 -158
- data/lib/minitest/reporters/mean_time_reporter.rb +392 -392
- data/lib/minitest/reporters/progress_reporter.rb +96 -96
- data/lib/minitest/reporters/ruby_mate_reporter.rb +54 -54
- data/lib/minitest/reporters/rubymine_reporter.rb +117 -117
- data/lib/minitest/reporters/spec_reporter.rb +61 -61
- data/lib/minitest/reporters/version.rb +5 -5
- data/lib/minitest/templates/index.html.erb +82 -82
- data/minitest-reporters.gemspec +31 -31
- data/test/fixtures/junit_filename_bug_example_test.rb +21 -21
- data/test/fixtures/mean_time_test.rb +8 -8
- data/test/fixtures/progress_detailed_skip_test.rb +8 -8
- data/test/fixtures/progress_test.rb +8 -8
- data/test/fixtures/sample_test.rb +15 -15
- data/test/fixtures/spec_test.rb +13 -13
- data/test/gallery/bad_test.rb +25 -25
- data/test/gallery/good_test.rb +14 -14
- data/test/integration/reporters/junit_reporter_test.rb +12 -12
- data/test/integration/reporters/mean_time_reporter_test.rb +7 -7
- data/test/integration/reporters/progress_reporter_test.rb +34 -34
- data/test/test_helper.rb +22 -22
- data/test/unit/minitest/extensible_backtrace_filter_test.rb +42 -42
- data/test/unit/minitest/mean_time_reporter_unit_test.rb +152 -152
- data/test/unit/minitest/minitest_reporter_plugin_test.rb +14 -14
- data/test/unit/minitest/reporters_test.rb +65 -65
- data/test/unit/minitest/spec_reporter_test.rb +41 -41
- metadata +4 -4
@@ -1,14 +1,14 @@
|
|
1
|
-
require_relative "../../test_helper"
|
2
|
-
|
3
|
-
module MinitestReportersTest
|
4
|
-
class MinitestReporterPluginTest < Minitest::Test
|
5
|
-
def test_delegates_io
|
6
|
-
reporter = Minitest::Reporters::DefaultReporter.new
|
7
|
-
io_handle = STDOUT
|
8
|
-
dr = Minitest::Reporters::DelegateReporter.new([ reporter ], :io => io_handle)
|
9
|
-
assert_equal io_handle, dr.io
|
10
|
-
dr.send :all_reporters
|
11
|
-
assert_equal io_handle, reporter.io
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
1
|
+
require_relative "../../test_helper"
|
2
|
+
|
3
|
+
module MinitestReportersTest
|
4
|
+
class MinitestReporterPluginTest < Minitest::Test
|
5
|
+
def test_delegates_io
|
6
|
+
reporter = Minitest::Reporters::DefaultReporter.new
|
7
|
+
io_handle = STDOUT
|
8
|
+
dr = Minitest::Reporters::DelegateReporter.new([ reporter ], :io => io_handle)
|
9
|
+
assert_equal io_handle, dr.io
|
10
|
+
dr.send :all_reporters
|
11
|
+
assert_equal io_handle, reporter.io
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,65 +1,65 @@
|
|
1
|
-
require_relative "../../test_helper"
|
2
|
-
require "minitest/mock"
|
3
|
-
|
4
|
-
module MinitestReportersTest
|
5
|
-
class ReportersTest < Minitest::Test
|
6
|
-
def test_chooses_the_rubymine_reporter_when_necessary
|
7
|
-
# Rubymine reporter complains when RubyMine libs are not available, so
|
8
|
-
# stub its #puts method out.
|
9
|
-
$stdout.stub :puts, nil do
|
10
|
-
reporters = Minitest::Reporters.choose_reporters [], { "RM_INFO" => "x" }
|
11
|
-
assert_instance_of Minitest::Reporters::RubyMineReporter, reporters[0]
|
12
|
-
|
13
|
-
reporters = Minitest::Reporters.choose_reporters [], { "TEAMCITY_VERSION" => "x" }
|
14
|
-
assert_instance_of Minitest::Reporters::RubyMineReporter, reporters[0]
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def test_chooses_the_textmate_reporter_when_necessary
|
19
|
-
reporters = Minitest::Reporters.choose_reporters [], {"TM_PID" => "x"}
|
20
|
-
assert_instance_of Minitest::Reporters::RubyMateReporter, reporters[0]
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_chooses_the_console_reporters_when_necessary
|
24
|
-
reporters = Minitest::Reporters.choose_reporters [Minitest::Reporters::SpecReporter.new], {}
|
25
|
-
assert_instance_of Minitest::Reporters::SpecReporter, reporters[0]
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_chooses_no_reporters_when_running_under_vim
|
29
|
-
reporters = Minitest::Reporters.choose_reporters(
|
30
|
-
[Minitest::Reporters::DefaultReporter.new], { "VIM" => "/usr/share/vim" })
|
31
|
-
assert_nil reporters
|
32
|
-
end
|
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
|
-
|
47
|
-
def test_uses_minitest_clock_time_when_minitest_version_greater_than_561
|
48
|
-
Minitest::Reporters.stub :minitest_version, 583 do
|
49
|
-
Minitest.stub :clock_time, 6765.378751009 do
|
50
|
-
clock_time = Minitest::Reporters.clock_time
|
51
|
-
assert_equal 6765.378751009, clock_time
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_uses_minitest_clock_time_when_minitest_version_less_than_561
|
57
|
-
Minitest::Reporters.stub :minitest_version, 431 do
|
58
|
-
Time.stub :now, Time.new(2015, 11, 20, 17, 35) do
|
59
|
-
clock_time = Minitest::Reporters.clock_time
|
60
|
-
assert_equal Time.new(2015, 11, 20, 17, 35), clock_time
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
1
|
+
require_relative "../../test_helper"
|
2
|
+
require "minitest/mock"
|
3
|
+
|
4
|
+
module MinitestReportersTest
|
5
|
+
class ReportersTest < Minitest::Test
|
6
|
+
def test_chooses_the_rubymine_reporter_when_necessary
|
7
|
+
# Rubymine reporter complains when RubyMine libs are not available, so
|
8
|
+
# stub its #puts method out.
|
9
|
+
$stdout.stub :puts, nil do
|
10
|
+
reporters = Minitest::Reporters.choose_reporters [], { "RM_INFO" => "x" }
|
11
|
+
assert_instance_of Minitest::Reporters::RubyMineReporter, reporters[0]
|
12
|
+
|
13
|
+
reporters = Minitest::Reporters.choose_reporters [], { "TEAMCITY_VERSION" => "x" }
|
14
|
+
assert_instance_of Minitest::Reporters::RubyMineReporter, reporters[0]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_chooses_the_textmate_reporter_when_necessary
|
19
|
+
reporters = Minitest::Reporters.choose_reporters [], {"TM_PID" => "x"}
|
20
|
+
assert_instance_of Minitest::Reporters::RubyMateReporter, reporters[0]
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_chooses_the_console_reporters_when_necessary
|
24
|
+
reporters = Minitest::Reporters.choose_reporters [Minitest::Reporters::SpecReporter.new], {}
|
25
|
+
assert_instance_of Minitest::Reporters::SpecReporter, reporters[0]
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_chooses_no_reporters_when_running_under_vim
|
29
|
+
reporters = Minitest::Reporters.choose_reporters(
|
30
|
+
[Minitest::Reporters::DefaultReporter.new], { "VIM" => "/usr/share/vim" })
|
31
|
+
assert_nil reporters
|
32
|
+
end
|
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
|
+
|
47
|
+
def test_uses_minitest_clock_time_when_minitest_version_greater_than_561
|
48
|
+
Minitest::Reporters.stub :minitest_version, 583 do
|
49
|
+
Minitest.stub :clock_time, 6765.378751009 do
|
50
|
+
clock_time = Minitest::Reporters.clock_time
|
51
|
+
assert_equal 6765.378751009, clock_time
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_uses_minitest_clock_time_when_minitest_version_less_than_561
|
57
|
+
Minitest::Reporters.stub :minitest_version, 431 do
|
58
|
+
Time.stub :now, Time.new(2015, 11, 20, 17, 35) do
|
59
|
+
clock_time = Minitest::Reporters.clock_time
|
60
|
+
assert_equal Time.new(2015, 11, 20, 17, 35), clock_time
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -1,41 +1,41 @@
|
|
1
|
-
require_relative "../../test_helper"
|
2
|
-
|
3
|
-
module MinitestReportersTest
|
4
|
-
class SpecReporterTest < Minitest::Test
|
5
|
-
def setup
|
6
|
-
@reporter = Minitest::Reporters::SpecReporter.new
|
7
|
-
@test = Minitest::Test.new("")
|
8
|
-
@test.time = 0
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_removes_underscore_in_name_if_shoulda
|
12
|
-
@test.name = "test_: Should foo"
|
13
|
-
assert_output(/test:/) do
|
14
|
-
@reporter.io = $stdout
|
15
|
-
@reporter.record(@test)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_wont_modify_name_if_not_shoulda
|
20
|
-
@test.name = "test_foo"
|
21
|
-
assert_output(/test_foo/) do
|
22
|
-
@reporter.io = $stdout
|
23
|
-
@reporter.record(@test)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_responds_to_test_name_after_record
|
28
|
-
test_name = 'test_: Should foo'
|
29
|
-
the_test_class = Class.new(Minitest::Test) do
|
30
|
-
define_method test_name do
|
31
|
-
assert(false)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
the_test = the_test_class.new('')
|
35
|
-
the_test.name = test_name
|
36
|
-
@reporter.io = StringIO.new
|
37
|
-
@reporter.record(the_test)
|
38
|
-
assert_respond_to the_test, the_test.name
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
1
|
+
require_relative "../../test_helper"
|
2
|
+
|
3
|
+
module MinitestReportersTest
|
4
|
+
class SpecReporterTest < Minitest::Test
|
5
|
+
def setup
|
6
|
+
@reporter = Minitest::Reporters::SpecReporter.new
|
7
|
+
@test = Minitest::Test.new("")
|
8
|
+
@test.time = 0
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_removes_underscore_in_name_if_shoulda
|
12
|
+
@test.name = "test_: Should foo"
|
13
|
+
assert_output(/test:/) do
|
14
|
+
@reporter.io = $stdout
|
15
|
+
@reporter.record(@test)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_wont_modify_name_if_not_shoulda
|
20
|
+
@test.name = "test_foo"
|
21
|
+
assert_output(/test_foo/) do
|
22
|
+
@reporter.io = $stdout
|
23
|
+
@reporter.record(@test)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_responds_to_test_name_after_record
|
28
|
+
test_name = 'test_: Should foo'
|
29
|
+
the_test_class = Class.new(Minitest::Test) do
|
30
|
+
define_method test_name do
|
31
|
+
assert(false)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
the_test = the_test_class.new('')
|
35
|
+
the_test.name = test_name
|
36
|
+
@reporter.io = StringIO.new
|
37
|
+
@reporter.record(the_test)
|
38
|
+
assert_respond_to the_test, the_test.name
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-reporters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -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:
|
169
|
+
version: 1.3.1
|
170
170
|
requirements: []
|
171
171
|
rubyforge_project: minitest-reporters
|
172
172
|
rubygems_version: 2.7.6
|