shopify-money 1.1.1 → 1.1.2

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
  SHA256:
3
- metadata.gz: ae2953d70e905d5f2425b6c334f5e8a920ec749a0e82341739b90dee7c446254
4
- data.tar.gz: 42fd32e212f52fb97c366cc39fe8bf462fff7be09ebb54690a6c7a3d80e5c08d
3
+ metadata.gz: 68cd70a11908e256c3743d9cd5c66ad2d3fb93eac02fd7973a5e8c20c6ca3e6b
4
+ data.tar.gz: c5619ce2dc46b6271ae96c326c57b8d4fc7dfef9f3696db1f140c83b5df0f5bf
5
5
  SHA512:
6
- metadata.gz: 538545671ca1a88fd930f5148b0477a2558a6166764439a2a30ff3a7b34f7057fbf510c11f238d44cae13296c2eb81cfd07ffa510bfacae2b8780c49920404ed
7
- data.tar.gz: 67944f9355d6b02e61c0e90f9e34cfd3ec7d3adea2f6dfbb45fc88241e38af516ad89726bd13b2e4a211e4adb26741f842904f92095e678808e1e25b871abfde
6
+ metadata.gz: 116fc4ca873f7373653509bc104d8343160877c3085ac2446dacbb918ecf2e823a915b9f2bb97ab48d7a39c4f2515518fa64ffece7a2c501b4a3958ea5455457
7
+ data.tar.gz: 3b702aa16acd05f2100589ac319931c268999e616ce28e741c921539000c39b48521807c6a81d1a0aaaf70c2f436a02a4f236109104db00bd4cdb5b9c8e9c01e
data/lib/money/helpers.rb CHANGED
@@ -10,6 +10,7 @@ class Money
10
10
 
11
11
  STRIPE_SUBUNIT_OVERRIDE = {
12
12
  'ISK' => 100,
13
+ 'UGX' => 100,
13
14
  }.freeze
14
15
 
15
16
  def value_to_decimal(num)
data/lib/money/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  class Money
3
- VERSION = "1.1.1"
3
+ VERSION = "1.1.2"
4
4
  end
data/spec/money_spec.rb CHANGED
@@ -376,6 +376,10 @@ RSpec.describe "Money" do
376
376
  expect(Money.from_subunits(100, 'ISK', format: :stripe)).to eq(Money.new(1, 'ISK'))
377
377
  end
378
378
 
379
+ it 'overrides the subunit_to_unit amount for UGX' do
380
+ expect(Money.from_subunits(100, 'UGX', format: :stripe)).to eq(Money.new(1, 'UGX'))
381
+ end
382
+
379
383
  it 'fallbacks to the default subunit_to_unit amount if no override is specified' do
380
384
  expect(Money.from_subunits(100, 'USD', format: :stripe)).to eq(Money.new(1, 'USD'))
381
385
  end
@@ -622,6 +626,10 @@ RSpec.describe "Money" do
622
626
  expect(Money.new(1, 'ISK').subunits(format: :stripe)).to eq(100)
623
627
  end
624
628
 
629
+ it 'overrides the subunit_to_unit amount for UGX' do
630
+ expect(Money.new(1, 'UGX').subunits(format: :stripe)).to eq(100)
631
+ end
632
+
625
633
  it 'fallbacks to the default subunit_to_unit amount if no override is specified' do
626
634
  expect(Money.new(1, 'USD').subunits(format: :stripe)).to eq(100)
627
635
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-money
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify Inc