minitest-power_assert 0.0.2 → 0.0.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
  SHA1:
3
- metadata.gz: 1a8358ee9f623d218c7d002d48e8eed812acdfdd
4
- data.tar.gz: 738e754bdc3cc5c62d449883ea06d497ec74bf79
3
+ metadata.gz: 1d2e866dc689a64be3201a57ab467b5477e54664
4
+ data.tar.gz: 3dd2089a012f1b22e9d897d16dcddf2d31a3d724
5
5
  SHA512:
6
- metadata.gz: 069a5de757c247e7bc533532b9498d827669b11b753385dd7ca416ef35299cdefd311199d322772b1b77d2fc3ba7a5d2876ed495321800c70c45d1d3ba1cfa09
7
- data.tar.gz: 65ca2d23349a2f2aca7a8da6ba662cfdbfe7ace06dab6d5c52e9f94726277c1e14d831a6915a05fd7ac402335ef6831c487d668f39a8a09419e07b5646b597ac
6
+ metadata.gz: 1c7ff0756ca01ab323239c51f9bbee0ff89a782b5297cd275e192a992aadeba86307e74f1fda9a8bcf681339397c43637bb08af70ba798701da289cb7c8c1e34
7
+ data.tar.gz: b1b9eedd7b6cad2ee19be3c6a07bd3e27250d111777b7c5ec5b3d4287b18ca7404f1335b905000e677d64ed8a7f4ddbdee8b63b602dcfde1e4be11731af46747
data/README.md CHANGED
@@ -24,6 +24,32 @@ Or install it yourself as:
24
24
 
25
25
  see [testcase](https://github.com/hsbt/minitest-power_assert/blob/master/test/test_power_assert.rb)
26
26
 
27
+ ### Basic Testcase
28
+
29
+ minitest-power_assert overwride assert method. You can use power_assert by assert with block.
30
+
31
+ ```ruby
32
+ class TestPowerAssert < Minitest::Test
33
+ def test_power_assert_failed
34
+ assert { "0".class == "3".to_i.times.map {|i| i + 1 }.class }
35
+ end
36
+ end
37
+ ```
38
+
39
+ If test is failed, you can see follow message.
40
+
41
+ ```shell
42
+ 1) Failure:
43
+ TestPowerAssert#test_power_assert_failed [test/test_power_assert.rb:10]:
44
+ assert { "0".class == "3".to_i.times.map {|i| i + 1 }.class }
45
+ | | | | |
46
+ | | | | Array
47
+ | | | [1, 2, 3]
48
+ | | #<Enumerator: 3:times>
49
+ | 3
50
+ String
51
+ ```
52
+
27
53
  ## Contributing
28
54
 
29
55
  1. Fork it ( https://github.com/[my-github-username]/minitest-power_assert/fork )
@@ -9,7 +9,8 @@ module Minitest
9
9
  def assert test = nil, msg = nil, &blk
10
10
  if block_given?
11
11
  ::PowerAssert.start(blk, assertion_method: __method__) do |pa|
12
- super pa.yield, pa.message_proc
12
+ # XXX workaround to break inline format with minitest-reporters.
13
+ super pa.yield, "\n#{pa.message_proc.call}"
13
14
  end
14
15
  else
15
16
  super test, msg
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module PowerAssert
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1,6 +1,5 @@
1
1
  require "minitest/autorun"
2
2
  require 'minitest/power_assert'
3
- require 'stringio'
4
3
 
5
4
  class TestPowerAssert < Minitest::Test
6
5
  def test_power_assert
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-power_assert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SHIBATA Hiroshi