coin-address-validators 0.0.1 → 0.0.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
  SHA1:
3
- metadata.gz: 39237dc4cfffa22cbf9e2706130e34b16b685ae8
4
- data.tar.gz: 4ba01e5c580ceda5a47e30305c0fb3efacdc3ca2
3
+ metadata.gz: 8505cc7abe02d2cab1f65b85d2a0c94e4123d34a
4
+ data.tar.gz: 36c3ea9f60a7e07274b8766c754ebcbbc54723fd
5
5
  SHA512:
6
- metadata.gz: a7ac81e40649316e1adec1c8e92d4ee4ce17ffcd2f334d28c9dcf5af5d9dc58e8dc0a61e1c43f4ed642875839495cb537d85b1d4404c139f66175573640b8424
7
- data.tar.gz: 0480aa904d2e2e407fbf862bab92bdd2fe4cf2dd320e3e1972c6914eafd5b040f7965cd047cad9a17ed217b0c307353a1c3ff728105aecd60f02f56f1176e4af
6
+ metadata.gz: 1430779091f39c62a1dc23d5e1498cd99640bd346bb6d156e1c39bb9f90885db0da48d5a9e471ccbcee20f68edaed8ff5134ab6c64b10d2bc05f4028d299442c
7
+ data.tar.gz: 9f13b7d932a823fd8085b35506935c3fde0532395df8cb020627286dbe14adec89ed2fbfabfcd3d881adc95197f5ef9f6f5050542dfd6e104298313a68e2c0b4
@@ -13,6 +13,7 @@ class CoinAddressValidators
13
13
  end
14
14
 
15
15
  def valid?(address)
16
+ return false if address.nil?
16
17
  inner_validator.valid?(address)
17
18
  end
18
19
 
@@ -1,3 +1,3 @@
1
1
  class CoinAddressValidators
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -48,5 +48,13 @@ RSpec.describe CoinAddressValidators do
48
48
  expect(CoinAddressValidators["xrp"].valid?("rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC")).to be_truthy
49
49
  end
50
50
  end
51
+
52
+ context "nil address" do
53
+ %w(btc bch eth ltc xrp).each do |coin|
54
+ it "returns false" do
55
+ expect(CoinAddressValidators[coin].valid?(nil)).to be_falsey
56
+ end
57
+ end
58
+ end
51
59
  end
52
60
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coin-address-validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phuong Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-20 00:00:00.000000000 Z
11
+ date: 2018-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitcoin-ruby