minitest-no_assertions 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/minitest/no_assertions.rb +22 -2
- data/lib/minitest/no_assertions/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eae19ebb7892bee3aaaf2ecc8b24a87f8d1479cb454ac70bcf6458b4bf43f60
|
4
|
+
data.tar.gz: 7b571cbaccc2b12654636afc14ed17e8be765d7de92092faf2964f3c932853c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8247be67fc3aa7bd80b12845a2fb081b4baffdffc3ad2438760e2f03e7686f828326b10187e6f1b62a87127253d1e1b30b40eec45297d9204d4fd73faf33b030
|
7
|
+
data.tar.gz: 91f5eff26573a66cf3937f2cac8ad4113b1d19a3a629b91cc550d270a1253b83c13b9dc6c2822abcb421f818c8e1dc27065c965746ba77973bd07ce3eb21ea25
|
data/.travis.yml
CHANGED
@@ -3,6 +3,16 @@ require "minitest"
|
|
3
3
|
|
4
4
|
module Minitest
|
5
5
|
module NoAssertions
|
6
|
+
class << self
|
7
|
+
def behavior=(behavior)
|
8
|
+
@behavior = behavior
|
9
|
+
end
|
10
|
+
|
11
|
+
def behavior
|
12
|
+
defined?(@behavior) ? @behavior : nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
6
16
|
class Reporter < Minitest::StatisticsReporter
|
7
17
|
def initialize(io = $stdout, options = {})
|
8
18
|
super(io, options)
|
@@ -10,8 +20,18 @@ module Minitest
|
|
10
20
|
|
11
21
|
def record(result)
|
12
22
|
if result.passed? && result.assertions.zero?
|
13
|
-
msg = "%s
|
14
|
-
|
23
|
+
msg = "%s has no assertions!! [%s]" % [result.location, result.source_location.join(":")]
|
24
|
+
warn(msg)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def warn(msg)
|
31
|
+
if Minitest::NoAssertions.behavior == :stderr
|
32
|
+
$stderr.puts(msg)
|
33
|
+
else
|
34
|
+
raise msg
|
15
35
|
end
|
16
36
|
end
|
17
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-no_assertions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Yaginuma
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|