zold-ruby-sdk 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/lib/zold/wts.rb +1 -1
- data/test/zold/test_wts.rb +14 -0
- data/zold-ruby-sdk.gemspec +2 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c43838a9818389a034a4fa45bf2b7e988f95702ced3f9f3759effc307466117
|
4
|
+
data.tar.gz: d334479f1a9723a1d6f3861d572153c8923e1eadd07d4ee9d8f2c3c393b0fd46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f24952817a9b8eed5457ed9e0752e783def9d2210bde45f8d8d9b6083483bf1964555cd88e07d950b796b8bdfb2ac94bd75d8dc83e2ab23e2a24845d084900c6
|
7
|
+
data.tar.gz: 8fbcd9afbf6b1d7df9a0304cd3fafe0beeecf416c01160ae2950e0b35e88159bec633de21f28839971ee0226c176023039a10a4f6786148faeaa09f98af7a257
|
data/.rubocop.yml
CHANGED
data/lib/zold/wts.rb
CHANGED
data/test/zold/test_wts.rb
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
|
23
23
|
require 'loog'
|
24
24
|
require 'minitest/autorun'
|
25
|
+
require 'webmock/minitest'
|
25
26
|
require_relative '../../lib/zold/wts'
|
26
27
|
|
27
28
|
# WTS test.
|
@@ -32,6 +33,7 @@ class TestWTS < Minitest::Test
|
|
32
33
|
KEY = '0000000000000000-b416493aefae4ca487c4739050aaec15'
|
33
34
|
|
34
35
|
def test_pulls
|
36
|
+
WebMock.allow_net_connect!
|
35
37
|
wts = Zold::WTS.new(KEY, log: Loog::VERBOSE)
|
36
38
|
job = wts.pull
|
37
39
|
wts.wait(job)
|
@@ -39,6 +41,7 @@ class TestWTS < Minitest::Test
|
|
39
41
|
end
|
40
42
|
|
41
43
|
def test_finds_transactions
|
44
|
+
WebMock.allow_net_connect!
|
42
45
|
wts = Zold::WTS.new(KEY, log: Loog::VERBOSE)
|
43
46
|
job = wts.pull
|
44
47
|
wts.wait(job)
|
@@ -46,11 +49,13 @@ class TestWTS < Minitest::Test
|
|
46
49
|
end
|
47
50
|
|
48
51
|
def test_retrieves_wallet_id
|
52
|
+
WebMock.allow_net_connect!
|
49
53
|
wts = Zold::WTS.new(KEY, log: Loog::VERBOSE)
|
50
54
|
assert(!wts.id.nil?)
|
51
55
|
end
|
52
56
|
|
53
57
|
def test_retrieves_balance
|
58
|
+
WebMock.allow_net_connect!
|
54
59
|
wts = Zold::WTS.new(KEY, log: Loog::VERBOSE)
|
55
60
|
job = wts.pull
|
56
61
|
wts.wait(job)
|
@@ -58,15 +63,24 @@ class TestWTS < Minitest::Test
|
|
58
63
|
end
|
59
64
|
|
60
65
|
def test_retrieves_usd_rate
|
66
|
+
WebMock.allow_net_connect!
|
61
67
|
wts = Zold::WTS.new(KEY, log: Loog::VERBOSE)
|
62
68
|
rate = wts.usd_rate
|
63
69
|
assert(!rate.nil?)
|
64
70
|
end
|
65
71
|
|
66
72
|
def test_works_with_fake
|
73
|
+
WebMock.allow_net_connect!
|
67
74
|
wts = Zold::WTS::Fake.new
|
68
75
|
job = wts.pull
|
69
76
|
wts.wait(job)
|
70
77
|
assert(!wts.balance.zero?)
|
71
78
|
end
|
79
|
+
|
80
|
+
def test_works_with_webmock
|
81
|
+
WebMock.disable_net_connect!
|
82
|
+
stub_request(:get, 'https://wts.zold.io/usd_rate').to_return(body: '1.234')
|
83
|
+
wts = Zold::WTS.new('fake', log: Loog::VERBOSE)
|
84
|
+
assert_equal(1.234, wts.usd_rate)
|
85
|
+
end
|
72
86
|
end
|
data/zold-ruby-sdk.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.rubygems_version = '2.2'
|
30
30
|
s.required_ruby_version = '>=2.5'
|
31
31
|
s.name = 'zold-ruby-sdk'
|
32
|
-
s.version = '0.2.
|
32
|
+
s.version = '0.2.1'
|
33
33
|
s.license = 'MIT'
|
34
34
|
s.summary = 'Zold score'
|
35
35
|
s.description = 'Ruby SDK for Zold online wallets management system (WTS)'
|
@@ -52,4 +52,5 @@ Gem::Specification.new do |s|
|
|
52
52
|
s.add_development_dependency 'rspec-rails', '3.8.1'
|
53
53
|
s.add_development_dependency 'rubocop', '0.62.0'
|
54
54
|
s.add_development_dependency 'rubocop-rspec', '1.31.0'
|
55
|
+
s.add_development_dependency 'webmock', '3.5.1'
|
55
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zold-ruby-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: loog
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 1.31.0
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: webmock
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - '='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 3.5.1
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - '='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 3.5.1
|
167
181
|
description: Ruby SDK for Zold online wallets management system (WTS)
|
168
182
|
email: yegor256@gmail.com
|
169
183
|
executables: []
|