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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fa8e58c479972f614bc5c56e24686c6c4d900ca09638db94a91ec76de9afd71
4
- data.tar.gz: 709846a9faf5a1d150b07a36b28ffaac1dc14e3f9bbe89e4a62cd28eeed901d7
3
+ metadata.gz: 9eae19ebb7892bee3aaaf2ecc8b24a87f8d1479cb454ac70bcf6458b4bf43f60
4
+ data.tar.gz: 7b571cbaccc2b12654636afc14ed17e8be765d7de92092faf2964f3c932853c0
5
5
  SHA512:
6
- metadata.gz: 6dbf0e549b5b85f26b2630cbd3b22251fb1dc61461a2c9e06822b6030a2c57ef898de06a2cea4eb3e962a21d1ac68d133b428d7ca1bfaa9c3e24dbd8d2dd41e0
7
- data.tar.gz: e7a9ebc5bd8834c8b61074132431f1360f90639e31f6a7d7a72d563c3bda02ea99f019b63f1d7e6143c005c09445eb413721d4514495484d222c4767bd5c32a8
6
+ metadata.gz: 8247be67fc3aa7bd80b12845a2fb081b4baffdffc3ad2438760e2f03e7686f828326b10187e6f1b62a87127253d1e1b30b40eec45297d9204d4fd73faf33b030
7
+ data.tar.gz: 91f5eff26573a66cf3937f2cac8ad4113b1d19a3a629b91cc550d270a1253b83c13b9dc6c2822abcb421f818c8e1dc27065c965746ba77973bd07ce3eb21ea25
data/.travis.yml CHANGED
@@ -4,4 +4,4 @@ language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
6
  - 2.5.1
7
- before_install: gem install bundler -v 1.16.4
7
+ before_install: gem install bundler
@@ -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#%s has no assertions!!" % [result.klass, result.name]
14
- raise StandardError, msg
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
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module NoAssertions
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  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.2
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-05 00:00:00.000000000 Z
11
+ date: 2018-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest