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 +4 -4
- data/README.md +26 -0
- data/lib/minitest/power_assert.rb +2 -1
- data/lib/minitest/power_assert/version.rb +1 -1
- data/test/test_power_assert.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d2e866dc689a64be3201a57ab467b5477e54664
|
4
|
+
data.tar.gz: 3dd2089a012f1b22e9d897d16dcddf2d31a3d724
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/test/test_power_assert.rb
CHANGED