satoshi-unit 0.1.4 → 0.1.5

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: 41cb4c206a9417270a6817b02ded0a24497ae265
4
- data.tar.gz: 5b925bc1994bee512ba7ac3e825f5a7529c10891
3
+ metadata.gz: 8bff6293bd864ce503e98eb6dd1c0abbb2c48311
4
+ data.tar.gz: 2146821dbf45f5ae26bad87108173d95d61258ca
5
5
  SHA512:
6
- metadata.gz: 5bd17a21670a36c6962c9f4efd39e0548b53275ed857e20a623f7ca1bdaadf4321ea0be7f1d8a0b518c221046b63b74b7c9f9eb932775188fd8507efd62607c2
7
- data.tar.gz: f0b4f142b6ac14735f79f81cb4acdfce57d530d505ba8dc86df29fef02a6c6a6d3e4cce9e6968db08d60c4b21710c80d6baca4b7f38e8f14c2e8a010d90fcadf
6
+ metadata.gz: 4afa3d171020ec116ac418f527dca400ca56144a6390aba31503f0c706e8e6047405066fada2122ba0c6c9b8e2ff8fd59faed7fadc85af875126edccfd281b13
7
+ data.tar.gz: 62c85f23fedea6abdbc05793d0e59fe12295b5da24337b61e4fd14fdc5498098f6b3ded23fa0b756d91610679f10889a9abf436def34ca6a45c5dbab9c9a3822
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -11,6 +11,7 @@ class Satoshi
11
11
  attr_reader :value, :from_unit, :to_unit
12
12
 
13
13
  def initialize(n=nil, from_unit: 'btc', to_unit: 'btc', unit: nil)
14
+ n = 0 if n.nil?
14
15
  if unit
15
16
  @from_unit = @to_unit = unit.downcase.to_sym
16
17
  else
@@ -2,16 +2,16 @@
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.4 ruby lib
5
+ # stub: satoshi-unit 0.1.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "satoshi-unit"
9
- s.version = "0.1.4"
9
+ s.version = "0.1.5"
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"]
13
13
  s.authors = ["Roman Snitko"]
14
- s.date = "2014-07-04"
14
+ s.date = "2014-07-29"
15
15
  s.description = "Converts various bitcoin denominations in Satoshis and back"
16
16
  s.email = "roman.snitko@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -39,4 +39,12 @@ describe Satoshi do
39
39
  expect(Satoshi.new(-1.00, unit: :mbtc).to_btc).to eq(-0.001)
40
40
  end
41
41
 
42
+ it "converts zero values correctly" do
43
+ expect(Satoshi.new(0, unit: :mbtc).to_unit).to eq(0)
44
+ end
45
+
46
+ it "converts nil values correctly" do
47
+ expect(Satoshi.new(nil, unit: :mbtc).to_unit).to eq(0)
48
+ end
49
+
42
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satoshi-unit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-04 00:00:00.000000000 Z
11
+ date: 2014-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler