minitest-fail 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/minitest/fail_plugin.rb +14 -1
- data/minitest-fail.gemspec +1 -1
- data/test/minitest/{fail_test.rb → fail_plugin_test.rb} +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 282856b4740c466f24b81932a619717a32fa97ba
|
4
|
+
data.tar.gz: 355b3fa5ce2e9506a0a47b503b0ba6f786807d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f5489533d26f38592cf0d64b14c2bf1f5d708dc6a8fb79ce839a34943eead4e8316c0b3d31d712b34536fa891e2cf2830c0c1f0dc167099856679b146136aef
|
7
|
+
data.tar.gz: 99dfe2beb07845e8c0ec31ed4c788bf4db2b47a8791a8c3039df0171f86dc68ad13f5657e453f4ec792098828f0f8dde4a11612337d3131ae96d96ca8c5f7d77
|
data/lib/minitest/fail_plugin.rb
CHANGED
@@ -28,11 +28,24 @@ module Minitest
|
|
28
28
|
empty_test = result.method(result.name).source_location
|
29
29
|
e = ::Minitest::Assertion.new "Empty test <#{result}>"
|
30
30
|
|
31
|
-
e.class
|
31
|
+
define_and_redefine e.class, :location do
|
32
|
+
-> { empty_test.join(":") }
|
33
|
+
end
|
32
34
|
|
33
35
|
result.failures << e
|
34
36
|
self.results << result
|
35
37
|
end
|
36
38
|
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def define_and_redefine klass, method
|
43
|
+
return unless block_given?
|
44
|
+
|
45
|
+
if klass.send :method_defined?, method
|
46
|
+
klass.send :remove_method, method
|
47
|
+
end
|
48
|
+
klass.send :define_method, method, yield
|
49
|
+
end
|
37
50
|
end
|
38
51
|
end
|
data/minitest-fail.gemspec
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-fail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Teo Ljungberg
|
@@ -67,7 +67,7 @@ files:
|
|
67
67
|
- lib/minitest/fail.rb
|
68
68
|
- lib/minitest/fail_plugin.rb
|
69
69
|
- minitest-fail.gemspec
|
70
|
-
- test/minitest/
|
70
|
+
- test/minitest/fail_plugin_test.rb
|
71
71
|
- test/minitest/test_case.rb
|
72
72
|
homepage: https://github.com/teoljungberg/minitest-fail
|
73
73
|
licenses:
|