sixarm_ruby_minitest_extensions 1.0.8 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/sixarm_ruby_minitest_extensions/assertions.rb +8 -0
- data/lib/sixarm_ruby_minitest_extensions/expectations.rb +2 -1
- data/test/sixarm_ruby_minitest_extensions_test/assertions_test.rb +31 -0
- data/test/sixarm_ruby_minitest_extensions_test/expectations_test.rb +31 -0
- metadata +32 -37
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3e1513643c8e2e8cba7314b1dac3250ea80361f9d97d890b40b5a0b3269641a2
|
4
|
+
data.tar.gz: c85911f68e6f49ea5c0252c1825146a26887f2f162517c2b7de6d00f9bd62314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa0d0bcb5fec11e81e5dc203fae9a5a06472c2b9214efc38af14a0af9a2a9e1de5648e07b028b576afe2726ee4bd9c6abcaf67a9be6af35fc9ac7cc9c0f0fb24
|
7
|
+
data.tar.gz: f1f2d5744a37c7289e5691ce185e55cad554795fe3bc110efbff2b3852cda786212607f2dec3a15aa317fb949b3deca0df71cd818435de674c72f289d8299e3b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -43,4 +43,12 @@ module Minitest::Assertions
|
|
43
43
|
assert_equal items_1.sort_by(&:hash), items_2.sort_by(&:hash), msg
|
44
44
|
end
|
45
45
|
|
46
|
+
##
|
47
|
+
# Succeeds when +items_1+ and +items_2+ have all equal items,
|
48
|
+
# when calling +meth+, regardless of ordering of the items.
|
49
|
+
|
50
|
+
def assert_equal_items_by items_1, items_2, meth, msg = nil
|
51
|
+
assert_equal items_1.map{|x| x.send(meth) }, items_2.map{|x| x.send(meth) }, msg
|
52
|
+
end
|
53
|
+
|
46
54
|
end
|
@@ -9,7 +9,8 @@ module Minitest::Expectations
|
|
9
9
|
[:assert_false, :must_be_false],
|
10
10
|
[:assert_exist, :must_exist],
|
11
11
|
[:assert_respond_to_all, :must_respond_to_all],
|
12
|
-
[:assert_equal_items, :must_have_equal_items]
|
12
|
+
[:assert_equal_items, :must_have_equal_items],
|
13
|
+
[:assert_equal_items_by, :must_have_equal_items_by]
|
13
14
|
]
|
14
15
|
pairs.each{|k,v|
|
15
16
|
Object.infect_an_assertion k, v, :reverse
|
@@ -90,6 +90,37 @@ describe "Minitest" do
|
|
90
90
|
|
91
91
|
end
|
92
92
|
|
93
|
+
describe "#assert_equal_items_by" do
|
94
|
+
|
95
|
+
class C
|
96
|
+
attr_accessor :a, :b
|
97
|
+
def initialize(a: nil, b: nil)
|
98
|
+
self.a = a
|
99
|
+
self.b = b
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "smoke test with some items" do
|
104
|
+
|
105
|
+
before do
|
106
|
+
@items_1 = [C.new(a: "alpha", b: "bravo_1")]
|
107
|
+
@items_2 = [C.new(a: "alpha", b: "bravo_2")]
|
108
|
+
end
|
109
|
+
|
110
|
+
it "works" do
|
111
|
+
assert_equal_items_by(@items_1, @items_2, :a)
|
112
|
+
end
|
113
|
+
|
114
|
+
it "fails" do
|
115
|
+
proc {
|
116
|
+
assert_equal_items_by(@items_1, @items_2, :b)
|
117
|
+
}.must_raise MiniTest::Assertion
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
93
124
|
end
|
94
125
|
|
95
126
|
end
|
@@ -90,6 +90,37 @@ describe "Minitest" do
|
|
90
90
|
|
91
91
|
end
|
92
92
|
|
93
|
+
describe "#must_have_equal_items_by" do
|
94
|
+
|
95
|
+
class C
|
96
|
+
attr_accessor :a, :b
|
97
|
+
def initialize(a: nil, b: nil)
|
98
|
+
self.a = a
|
99
|
+
self.b = b
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe "smoke test with some items" do
|
104
|
+
|
105
|
+
before do
|
106
|
+
@items_1 = [C.new(a: "alpha", b: "bravo_1")]
|
107
|
+
@items_2 = [C.new(a: "alpha", b: "bravo_2")]
|
108
|
+
end
|
109
|
+
|
110
|
+
it "works" do
|
111
|
+
expect(@items_1).must_have_equal_items_by @items_2, :a
|
112
|
+
end
|
113
|
+
|
114
|
+
it "fails" do
|
115
|
+
proc {
|
116
|
+
expect(@items_1).must_have_equal_items_by @items_2, :b
|
117
|
+
}.must_raise MiniTest::Assertion
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
123
|
+
|
93
124
|
end
|
94
125
|
|
95
126
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sixarm_ruby_minitest_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SixArm
|
@@ -10,41 +10,36 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
Drcxp/zlVhud+a0ezdnyNvF520arJWvqA4GrOo8F+TT2vVrjscgYjiVGdSq+8wQv
|
42
|
-
Efa5jhe8QwG7R1rdpMMP5yBSAqWuFBczMveX5j4rp9Ifw5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8SFPeI1HFa9NH47pqtxF1YKpNIEVc
|
40
|
+
2xa2BNHSePe7tys/2hbmZuyMu8X5ERmovsabSXB3a+YwtJh5c2jhA21wF7986s0q
|
46
41
|
-----END CERTIFICATE-----
|
47
|
-
date:
|
42
|
+
date: 2018-04-03 00:00:00.000000000 Z
|
48
43
|
dependencies:
|
49
44
|
- !ruby/object:Gem::Dependency
|
50
45
|
name: minitest
|
@@ -156,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
151
|
requirements:
|
157
152
|
- - ">="
|
158
153
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
154
|
+
version: '2.2'
|
160
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
156
|
requirements:
|
162
157
|
- - ">="
|
@@ -164,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
159
|
version: '0'
|
165
160
|
requirements: []
|
166
161
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.6
|
162
|
+
rubygems_version: 2.7.6
|
168
163
|
signing_key:
|
169
164
|
specification_version: 4
|
170
165
|
summary: SixArm.com → Ruby → Minitest extensions
|
metadata.gz.sig
CHANGED
Binary file
|