satoshi-unit 0.1.5 → 0.1.6

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: 8bff6293bd864ce503e98eb6dd1c0abbb2c48311
4
- data.tar.gz: 2146821dbf45f5ae26bad87108173d95d61258ca
3
+ metadata.gz: bb777072c2a1a0ffce14e87ab258e5061cc66223
4
+ data.tar.gz: 27105dfacc7adecf8652ef963e69fb33c2ac5c93
5
5
  SHA512:
6
- metadata.gz: 4afa3d171020ec116ac418f527dca400ca56144a6390aba31503f0c706e8e6047405066fada2122ba0c6c9b8e2ff8fd59faed7fadc85af875126edccfd281b13
7
- data.tar.gz: 62c85f23fedea6abdbc05793d0e59fe12295b5da24337b61e4fd14fdc5498098f6b3ded23fa0b756d91610679f10889a9abf436def34ca6a45c5dbab9c9a3822
6
+ metadata.gz: f5bc73d4e53c12217ef148520d65f483bd576ef628dec00ee3f27eefaf400b45891953d61b798d449e0e92ede229be15e4915419184ad0e5556ceba5821cd999
7
+ data.tar.gz: a367d6b43c2a41047ab0fa66c30e23d9f6ff970cc192ddc50fe8d60d1bf6c302adab51a0017a792be438262e04720cb5682faaa9377caaa703843d993ba7afa9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -40,6 +40,7 @@ class Satoshi
40
40
  alias :satoshi_value :to_i
41
41
 
42
42
  def value=(n)
43
+ n = 0 if n.nil?
43
44
  @value = convert_to_satoshi(n)
44
45
  end
45
46
 
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: satoshi-unit 0.1.5 ruby lib
5
+ # stub: satoshi-unit 0.1.6 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "satoshi-unit"
9
- s.version = "0.1.5"
9
+ s.version = "0.1.6"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -44,7 +44,10 @@ describe Satoshi do
44
44
  end
45
45
 
46
46
  it "converts nil values correctly" do
47
- expect(Satoshi.new(nil, unit: :mbtc).to_unit).to eq(0)
47
+ s = Satoshi.new(nil, unit: :mbtc)
48
+ expect(s.value).to eq(0)
49
+ s.value = nil
50
+ expect(s.to_unit).to eq(0)
48
51
  end
49
52
 
50
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satoshi-unit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko