sibit 0.19.1 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63efa03d475df765f994bd609f8f5deb31cea1450566f1e68a8c5a8ac497ec0c
4
- data.tar.gz: c36540c991e462bf6825d9a48109a3f0c1a4ca1934b4741a17074a3cf8503565
3
+ metadata.gz: db71c5de986c5aeacfb60ddde907c84eade4b53e2b764f513cd6ea20c7a95c45
4
+ data.tar.gz: c79bc1c5b9c544bcc16a61fff3912f09dd5b05152d5cbf667b418d5207d37575
5
5
  SHA512:
6
- metadata.gz: 98cc194b64718dc11ba35650a6c1bda4b52e4ca04cd935784f45387fb6dbdb552de00343d5e7dfd90ba796137500028bf5c31177006a087f2ec2a754751d3a5e
7
- data.tar.gz: 161f739388531e1b79ca07860d374023c0ff8109de32b35d35dc487892b4fa09e2db2471a524983aa8f2e35723806053dcbeb0e98ecc9ff2e8ecfe2e1da737ec
6
+ metadata.gz: 951c554ef902b64007c6807976c99f44f909a28730bff366135d5fb2728cae935df206fd065f9500d4f885982c10175c9775ba3001bb37de42ad2f2969dd45ee
7
+ data.tar.gz: b60396b85498717187962637e00008b394eddcb030cdfb5839b3d043bfc086974f05f638057940f621ab1d7d60016857ed19d7bb0354325adcd3e5ebc964f3da
@@ -110,8 +110,8 @@ class Sibit
110
110
  end
111
111
  end
112
112
  if results.empty?
113
- raise Sibit::Error, "No APIs out of #{@api.length} managed to succeed at #{method}(): \
114
- #{@api.map { |a| a.class.name }.join(', ')}"
113
+ raise Sibit::Error, "No APIs out of #{@list.length} managed to succeed at #{method}(): \
114
+ #{@list.map { |a| a.class.name }.join(', ')}"
115
115
  end
116
116
  results.group_by(&:to_s).values.max_by(&:size)[0]
117
117
  end
@@ -113,8 +113,8 @@ class Sibit
113
113
  end
114
114
  end
115
115
  unless done
116
- raise Sibit::Error, "No APIs out of #{@api.length} managed to succeed at #{method}(): \
117
- #{@api.map { |a| a.class.name }.join(', ')}"
116
+ raise Sibit::Error, "No APIs out of #{@list.length} managed to succeed at #{method}(): \
117
+ #{@list.map { |a| a.class.name }.join(', ')}"
118
118
  end
119
119
  result
120
120
  end
@@ -26,5 +26,5 @@
26
26
  # License:: MIT
27
27
  class Sibit
28
28
  # Current version of the library.
29
- VERSION = '0.19.1'
29
+ VERSION = '0.19.2'
30
30
  end
@@ -47,4 +47,16 @@ class TestBestOf < Minitest::Test
47
47
  assert_equal(64, sibit.latest.length)
48
48
  assert_equal(12, sibit.fees[:S])
49
49
  end
50
+
51
+ def test_all_fail
52
+ api = Class.new do
53
+ def latest
54
+ raise Sibit::Error, 'intentionally'
55
+ end
56
+ end.new
57
+ sibit = Sibit::BestOf.new([api, api])
58
+ assert_raises Sibit::Error do
59
+ sibit.latest
60
+ end
61
+ end
50
62
  end
@@ -47,4 +47,16 @@ class TestFirstOf < Minitest::Test
47
47
  assert_equal(64, sibit.latest.length)
48
48
  assert_equal(12, sibit.fees[:S])
49
49
  end
50
+
51
+ def test_all_fail
52
+ api = Class.new do
53
+ def latest
54
+ raise Sibit::Error, 'intentionally'
55
+ end
56
+ end.new
57
+ sibit = Sibit::FirstOf.new([api, api])
58
+ assert_raises Sibit::Error do
59
+ sibit.latest
60
+ end
61
+ end
50
62
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1
4
+ version: 0.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2020-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace