shopify-money 0.11.2 → 0.11.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a4ff9c5c0514d928eb29644cca8da3e19123b2f
4
- data.tar.gz: 99e5abcead9b256bd4fe950c6c84e9af762074f1
3
+ metadata.gz: 53109f360b32e2f8fe8c6ade1992ba9a50c4a27d
4
+ data.tar.gz: 63b5789d8f13897ddba4ce87e857d8d60092d026
5
5
  SHA512:
6
- metadata.gz: 83ff997ed70b2edd7730b950e7557e813e7c01b1b4b85cd10f5e1957773b0e164811dce6ea20860221763443a9cb0f4399ae973f5664060a4097fe53b1ff5c4b
7
- data.tar.gz: 58c3dcb9062789668e00758c6cfd78856e7ef3f0b78fe468187a2c605591e6a21c5aaee3589cf86bef7c5a93d458ddd74571d27596392685bc6333503ba63adb
6
+ metadata.gz: b602fb6b125c484290a44d6269b14f209c7699d58830bbcf50589b8588b02d4c15d2030dd9ef91890e770fb4e3ba205d2b974a529c120285ff62b673ac0c19e7
7
+ data.tar.gz: 3e6c25119ade6fa8a8e4236f5779e64baaaa6e771c1f7be10204334066de7b94a516eeafe98a144cf8467069fed0d3490823a78093fe0318381e09e6c137ba6e
@@ -23,8 +23,8 @@ class Money
23
23
  end
24
24
  alias_method :from_amount, :new
25
25
 
26
- def zero
27
- new(0, NULL_CURRENCY)
26
+ def zero(currency = NULL_CURRENCY)
27
+ new(0, currency)
28
28
  end
29
29
  alias_method :empty, :zero
30
30
 
@@ -1,3 +1,3 @@
1
1
  class Money
2
- VERSION = "0.11.2"
2
+ VERSION = "0.11.3"
3
3
  end
@@ -34,6 +34,10 @@ RSpec.describe "Money" do
34
34
  expect(Money.zero).to eq(Money.new(0))
35
35
  end
36
36
 
37
+ it ".zero accepts an optional currency" do
38
+ expect(Money.zero('USD')).to eq(Money.new(0, 'USD'))
39
+ end
40
+
37
41
  it "returns itself with to_money" do
38
42
  expect(money.to_money).to eq(money)
39
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-17 00:00:00.000000000 Z
11
+ date: 2018-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler