sixarm_ruby_minitest_extensions 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +2 -1
- data/VERSION +1 -1
- data/lib/sixarm_ruby_minitest_extensions/assertions.rb +8 -3
- data/lib/sixarm_ruby_minitest_extensions/expectations.rb +10 -4
- data/test/sixarm_ruby_minitest_extensions_test/assertions_test.rb +22 -0
- data/test/sixarm_ruby_minitest_extensions_test/expectations_test.rb +22 -0
- metadata +1 -1
- metadata.gz.sig +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0febece1571a1175e4e0332f33cee7dddb35b114
|
4
|
+
data.tar.gz: 07600419a25889feb061a2a3329911b08917b2b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d83459285c0987c2839525bcb280d53a838e68f196e0f363d18f9b5e1d6f86cf88a882ef2b66dca40fdf30d519bd9726149af6d108f44d5bdd8b0b0f23bf4bd
|
7
|
+
data.tar.gz: bb22261408def1f885be2794f044e3ed5821f84d1705651a7eb43eae477a00f9d431a3d15789071dfb5760b6b1fa3b56f1e6227583ca9997b822af3f61188d88
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -81,7 +81,8 @@ Example Minitest spec:
|
|
81
81
|
|
82
82
|
## Changes
|
83
83
|
|
84
|
-
* 2013-07-
|
84
|
+
* 2013-07-27 1.0.4 Add #assert_exist and #must_exist
|
85
|
+
* 2013-07-26 1.0.3 Add #assert_equal_items and #must_have_equal_items
|
85
86
|
* 2013-06-04 1.0.2 Update to enable "Minitest" vs. "MiniTest"
|
86
87
|
* 2013-06-03 1.0.1 Update for Minitest 5.x
|
87
88
|
* 2013-06-02 1.0.0 Publish
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
@@ -19,6 +19,13 @@ module Minitest::Assertions
|
|
19
19
|
assert_same exp, false, msg
|
20
20
|
end
|
21
21
|
|
22
|
+
##
|
23
|
+
# Succeeds when +obj+ exists, i.e. is not nil.
|
24
|
+
|
25
|
+
def assert_exist obj, msg
|
26
|
+
refute_nil obj, msg
|
27
|
+
end
|
28
|
+
|
22
29
|
##
|
23
30
|
# Succeeds when +obj+ responds to each method in +meths+.
|
24
31
|
|
@@ -33,9 +40,7 @@ module Minitest::Assertions
|
|
33
40
|
# regardless of ordering of the items.
|
34
41
|
|
35
42
|
def assert_equal_items items_1, items_2, msg = nil
|
36
|
-
|
37
|
-
hashes_2 = items_2.map{|item| item.hash}.sort
|
38
|
-
assert_equal hashes_1, hashes_2, msg
|
43
|
+
assert_equal items_1.sort_by(&:hash), items_2.sort_by(&:hash), msg
|
39
44
|
end
|
40
45
|
|
41
46
|
end
|
@@ -4,9 +4,15 @@ Please see README
|
|
4
4
|
=end
|
5
5
|
|
6
6
|
module Minitest::Expectations
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
pairs = [
|
8
|
+
[:assert_true, :must_be_true],
|
9
|
+
[:assert_false, :must_be_false],
|
10
|
+
[:assert_exist, :must_exist],
|
11
|
+
[:assert_respond_to_all, :must_respond_to_all],
|
12
|
+
[:assert_equal_items, :must_have_equal_items]
|
13
|
+
]
|
14
|
+
pairs.each{|k,v|
|
15
|
+
Object.infect_an_assertion k, v, :reverse
|
16
|
+
}
|
11
17
|
end
|
12
18
|
|
@@ -32,6 +32,28 @@ describe "Minitest" do
|
|
32
32
|
|
33
33
|
end
|
34
34
|
|
35
|
+
describe "#assert_exit" do
|
36
|
+
|
37
|
+
specify "true #=> success" do
|
38
|
+
assert_exist(true).must_be_same_as true
|
39
|
+
end
|
40
|
+
|
41
|
+
specify "false #=> success" do
|
42
|
+
assert_exist(false).must_be_same_as true
|
43
|
+
end
|
44
|
+
|
45
|
+
specify "0 #=> success" do
|
46
|
+
assert_exist(0).must_be_same_as true
|
47
|
+
end
|
48
|
+
|
49
|
+
specify "nil #=> failure" do
|
50
|
+
proc {
|
51
|
+
assert_exist(nil)
|
52
|
+
}.must_raise MiniTest::Assertion
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
35
57
|
describe "#assert_respond_to_all" do
|
36
58
|
|
37
59
|
describe "smoke test with some string methods" do
|
@@ -32,6 +32,28 @@ describe "Minitest" do
|
|
32
32
|
|
33
33
|
end
|
34
34
|
|
35
|
+
describe "#must_exist" do
|
36
|
+
|
37
|
+
specify "true #=> success" do
|
38
|
+
true.must_exisit
|
39
|
+
end
|
40
|
+
|
41
|
+
specify "false #=> success" do
|
42
|
+
false.must_exisit
|
43
|
+
end
|
44
|
+
|
45
|
+
specify "0 #=> success" do
|
46
|
+
false.must_exisit
|
47
|
+
end
|
48
|
+
|
49
|
+
specify "nil #=> failure" do
|
50
|
+
proc {
|
51
|
+
nil.must_exisit
|
52
|
+
}.must_raise MiniTest::Assertion
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
35
57
|
describe "#must_respond_to_all" do
|
36
58
|
|
37
59
|
describe "smoke test with some string methods" do
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
�]1v�i�õ�JuF��=�''Om=*l����j���i��3���F�cJ��M��������~��|��hE�0�V�Ȓ�h@N"�{����9��}7��0 �MC3�6(�J��6/��s�����\��-
|