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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 442245e9ef4d89ba18577b941bff47f4849f0fab
4
- data.tar.gz: 995fe72bbe09354e1ba15e1adde2d80e5dac2455
2
+ SHA256:
3
+ metadata.gz: 3e1513643c8e2e8cba7314b1dac3250ea80361f9d97d890b40b5a0b3269641a2
4
+ data.tar.gz: c85911f68e6f49ea5c0252c1825146a26887f2f162517c2b7de6d00f9bd62314
5
5
  SHA512:
6
- metadata.gz: 87dc01f8c7181383e3a20b4c4e85261228ad95f5c786844513a2cfbe34c42a9ca3f43976f5cfb91c60aa58143325daa5342938e525a0690a1b1d046245a1c877
7
- data.tar.gz: ded3e169049b705e8b29676554d199030eb6e169b2438a8b3e873ce90bd229506e1190dfe5dfc5892cbe34c23ba9daff30b9190d6385467aa29ebacea7dfe36a
6
+ metadata.gz: aa0d0bcb5fec11e81e5dc203fae9a5a06472c2b9214efc38af14a0af9a2a9e1de5648e07b028b576afe2726ee4bd9c6abcaf67a9be6af35fc9ac7cc9c0f0fb24
7
+ data.tar.gz: f1f2d5744a37c7289e5691ce185e55cad554795fe3bc110efbff2b3852cda786212607f2dec3a15aa317fb949b3deca0df71cd818435de674c72f289d8299e3b
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.0.8
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
- MIIGCTCCA/GgAwIBAgIJAK3igyLv2hNNMA0GCSqGSIb3DQEBBQUAMGAxCzAJBgNV
14
- BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp
15
- c2NvMQ8wDQYDVQQKEwZTaXhBcm0xEzARBgNVBAMTCnNpeGFybS5jb20wHhcNMTUw
16
- MzE0MjA0MTE5WhcNMTcxMjA4MjA0MTE5WjBgMQswCQYDVQQGEwJVUzETMBEGA1UE
17
- CBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEPMA0GA1UEChMG
18
- U2l4QXJtMRMwEQYDVQQDEwpzaXhhcm0uY29tMIICIjANBgkqhkiG9w0BAQEFAAOC
19
- Ag8AMIICCgKCAgEA4et7SlePzuE46eK5BAVVGg+yWt6FkX7xcLt3Uun9RntKPSuR
20
- TbS/+KBqbja5reZD64hdQ9npxpQPKafxUm+RlCd9F5KFxwi8G9usKzCTPOwUeDI2
21
- TNEfC+1eRU19QuEW58ZC0pC/bx5Zmp6/DTD6VV+qxKEE9U1M5P85LNkwnxqmRIMR
22
- AN8VKOG+GRGOMNDGZ8Kp4h5V3Wyu0N7anY8AUveIx1SyLrEbAhcWp1asLs+/H22q
23
- 92YFgnwTtnDpZsAmNgZrVw9xY0v79BXqPoyKIl2psPfZi2mOIWi/N+cx6LGF1G+B
24
- b+NZdAgwuLyFOoVknkTqsuYEsFhxz0dqDUgM/RvGrADxZk6yUD/1lBNTWnIDVKaN
25
- Onu08gOb1lfn21Sbd5r/K32hngasiEuDvh61pJ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
+ 2xa2BNHSePe7tys/2hbmZuyMu8X5ERmovsabSXB3a+YwtJh5c2jhA21wF7986s0q
46
41
  -----END CERTIFICATE-----
47
- date: 2017-08-14 00:00:00.000000000 Z
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: '0'
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.12
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