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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bb7ea0cdae496992e62f48d48b6ffa9383e1e5f
4
- data.tar.gz: 8fb79935f20fd2d3b21d9e90a586b1f1763c3279
3
+ metadata.gz: 282856b4740c466f24b81932a619717a32fa97ba
4
+ data.tar.gz: 355b3fa5ce2e9506a0a47b503b0ba6f786807d73
5
5
  SHA512:
6
- metadata.gz: edf8ec90add40c4802f2078b777f896edbd1a56df16b75e99b2c0483b0e81b152f1bcdb4278c5e10f389892ec18c3ab20cc69b0b518f9a52ce12efd614a9ab93
7
- data.tar.gz: 29b84ca8cef5513d50ace062a1611d7611b0323bc24ad94122f1781c278170a391e622c97556c5c5ddc599515ed0849e134194d76351e5e46eec8b1d626cd64a
6
+ metadata.gz: 5f5489533d26f38592cf0d64b14c2bf1f5d708dc6a8fb79ce839a34943eead4e8316c0b3d31d712b34536fa891e2cf2830c0c1f0dc167099856679b146136aef
7
+ data.tar.gz: 99dfe2beb07845e8c0ec31ed4c788bf4db2b47a8791a8c3039df0171f86dc68ad13f5657e453f4ec792098828f0f8dde4a11612337d3131ae96d96ca8c5f7d77
@@ -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.send :define_method, :location, -> { empty_test.join(":") }
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "minitest-fail"
5
- spec.version = "0.0.3"
5
+ spec.version = "0.0.4"
6
6
  spec.authors = ["Teo Ljungberg"]
7
7
  spec.email = ["teo.ljungberg@gmail.com"]
8
8
  spec.summary = %q{Make an empty test fail}
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.3
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/fail_test.rb
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: