minitest-server 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +5 -1
- data/History.rdoc +7 -0
- data/lib/minitest/server.rb +1 -1
- data/lib/minitest/server_plugin.rb +11 -1
- data/test/minitest/test_server.rb +99 -4
- metadata +12 -13
- metadata.gz.sig +0 -0
- data/.gemtest +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97e2a1243b605181c638d6bb2f8573671146986c
|
4
|
+
data.tar.gz: 5f0051d209693dd5cca103da5507d0721b3636d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa7e18d88937623aa6cdb4dcbbce983bf2b3f2a5de9b9c7dbb5f326600ddf38c943a9bd36330ac6298114d3b7ea9f83447f83c88d56ad4c645cb61adac78b870
|
7
|
+
data.tar.gz: 74ef751b6d92ba657b0cdffe947315820b9fc456960e0dcc63d8b06778f3576ad9f23ce14adf760f00a51a5921a1639424fad32f51d29dfe3d87367a17d9704a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
data/History.rdoc
CHANGED
data/lib/minitest/server.rb
CHANGED
@@ -44,14 +44,24 @@ class Minitest::ServerReporter < Minitest::AbstractReporter
|
|
44
44
|
# embedded exception might not be able to be marshaled.
|
45
45
|
bt = e.exception.backtrace
|
46
46
|
|
47
|
-
ex = RuntimeError.new(e.message)
|
47
|
+
ex = RuntimeError.new(e.exception.message)
|
48
48
|
e.exception = ex
|
49
49
|
ex.set_backtrace bt
|
50
50
|
|
51
|
+
e = Minitest::UnexpectedError.new ex # ugh. some rails plugin. ugh.
|
52
|
+
|
51
53
|
if ex.instance_variables.include? :@bindings then # web-console is Evil
|
52
54
|
ex.instance_variable_set :@bindings, nil
|
53
55
|
e.instance_variable_set :@bindings, nil
|
54
56
|
end
|
57
|
+
when Minitest::Assertion then
|
58
|
+
bt = e.backtrace
|
59
|
+
e = e.class.new(e.message)
|
60
|
+
e.set_backtrace bt
|
61
|
+
when Minitest::Skip then
|
62
|
+
# do nothing
|
63
|
+
else
|
64
|
+
warn "Unhandled exception type: #{e.class}\n\n#{e.inspect}"
|
55
65
|
end
|
56
66
|
|
57
67
|
e
|
@@ -1,10 +1,105 @@
|
|
1
1
|
require "minitest/autorun"
|
2
2
|
require "minitest/server"
|
3
|
+
require "minitest/server_plugin"
|
3
4
|
|
4
|
-
|
5
|
+
require "minitest"
|
6
|
+
require "minitest/test"
|
7
|
+
require "minitest/server"
|
8
|
+
require "minitest/server_plugin"
|
9
|
+
require "minitest/autorun"
|
10
|
+
|
11
|
+
class BogoTests < Minitest::Test
|
12
|
+
def pass_test
|
13
|
+
assert true
|
14
|
+
end
|
15
|
+
|
16
|
+
def fail_test
|
17
|
+
assert false, "fail"
|
18
|
+
end
|
19
|
+
|
20
|
+
def error_test
|
21
|
+
raise "error"
|
22
|
+
rescue => e
|
23
|
+
e.instance_variable_set :@binding, binding
|
24
|
+
raise e
|
25
|
+
end
|
26
|
+
|
27
|
+
def wtf_test
|
28
|
+
assert false, "wtf"
|
29
|
+
rescue Minitest::Assertion => e
|
30
|
+
e.instance_variable_set :@proc, proc { 42 }
|
31
|
+
raise e
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class TestServerReporter < Minitest::ServerReporter
|
36
|
+
def record o
|
37
|
+
super
|
38
|
+
|
39
|
+
Marshal.dump o
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class Client
|
44
|
+
def run pid, type
|
45
|
+
reporter = TestServerReporter.new pid
|
46
|
+
reporter.start
|
47
|
+
|
48
|
+
reporter.record Minitest.run_one_method(BogoTests, "#{type}_test")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class Server
|
53
|
+
attr_accessor :results
|
54
|
+
|
55
|
+
def self.run type = nil
|
56
|
+
s = self.new
|
57
|
+
s.run type
|
58
|
+
s.results
|
59
|
+
end
|
60
|
+
|
61
|
+
def run type = nil
|
62
|
+
Minitest::Server.run self
|
63
|
+
|
64
|
+
Client.new.run $$, type
|
65
|
+
ensure
|
66
|
+
Minitest::Server.stop
|
67
|
+
end
|
68
|
+
|
69
|
+
def minitest_start
|
70
|
+
# do nothing
|
71
|
+
end
|
72
|
+
|
73
|
+
def minitest_result(*vals)
|
74
|
+
self.results = vals
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class ServerTest < Minitest::Test
|
79
|
+
def test_pass
|
80
|
+
assert_run "pass", [], 1
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_fail
|
84
|
+
assert_run "fail", ["fail"], 1
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_error
|
88
|
+
msg = ["RuntimeError: error\n #{__FILE__}:21:in `error_test'"]
|
89
|
+
assert_run "error", msg, 0
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_wtf
|
93
|
+
assert_run "wtf", ["wtf"], 1
|
94
|
+
end
|
95
|
+
|
96
|
+
def assert_run type, e, n
|
97
|
+
act = Server.run type
|
98
|
+
act[-1] = 0 # time
|
99
|
+
act[-3].map!(&:message)
|
100
|
+
|
101
|
+
exp = ["test/minitest/test_server.rb", "BogoTests", "#{type}_test", e, n, 0]
|
5
102
|
|
6
|
-
|
7
|
-
def test_sanity
|
8
|
-
# flunk "write tests or I will kneecap you"
|
103
|
+
assert_equal exp, act
|
9
104
|
end
|
10
105
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
|
14
14
|
ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
|
15
|
-
|
15
|
+
GRYDY29tMB4XDTE1MDkxOTIwNTEyMloXDTE2MDkxODIwNTEyMlowRTETMBEGA1UE
|
16
16
|
AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
|
17
17
|
JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
|
18
18
|
b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
|
@@ -22,14 +22,14 @@ cert_chain:
|
|
22
22
|
qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
|
23
23
|
gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
|
24
24
|
HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
AQB+Hx8xUgrpZa4P8H8gR8zme5kISwQrG80MbpqJV6/G3/ZicRFhN5sjwu0uHGue
|
26
|
+
bd9Cymf6oIRwHVarJux2M32T6bL07Hmi07w2QaPc3MnMKB/D46SRZ2JSSGPFRBTc
|
27
|
+
SilobMRoGs/7B15uGFUEnNrCB/ltMqhwwSx1r++UQPfeySHEV9uqu03E5Vb7J37O
|
28
|
+
2Er6PLXHRiYsIycD1LkMi6YnixdITRHmrqJYE2rsjaIfpIehiusVAPHkNf7qbpHq
|
29
|
+
qx3h45R1CAsObX0SQDIT+rRbQrtKz1GHIZTOFYvEJjUY1XmRTZupD3CJ8Q7sDqSy
|
30
|
+
NLq5jm1fq6Y9Uolu3RJbmycf
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2016-05-03 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: minitest
|
@@ -65,14 +65,14 @@ dependencies:
|
|
65
65
|
requirements:
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.15'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '3.
|
75
|
+
version: '3.15'
|
76
76
|
description: |-
|
77
77
|
minitest-server provides a client/server setup with your minitest
|
78
78
|
process, allowing your test run to send its results directly to a
|
@@ -87,7 +87,6 @@ extra_rdoc_files:
|
|
87
87
|
- README.rdoc
|
88
88
|
files:
|
89
89
|
- .autotest
|
90
|
-
- .gemtest
|
91
90
|
- History.rdoc
|
92
91
|
- Manifest.txt
|
93
92
|
- README.rdoc
|
metadata.gz.sig
CHANGED
Binary file
|
data/.gemtest
DELETED
File without changes
|