shopify-money 3.1.1 → 3.1.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 +4 -4
- data/.github/workflows/tests.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile.lock +2 -2
- data/lib/money/helpers.rb +1 -0
- data/lib/money/version.rb +1 -1
- data/spec/money_spec.rb +6 -0
- data/spec/splitter_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03fea29a7733cd7ac14493fff381a197b42a16de9369c8a15b0bba9905f7a8a0
|
4
|
+
data.tar.gz: '025213910adf2f5090dfb7afaa85f715f05515094e15f14c25b5805eaef569eb'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dad64b959edcde085fc92904dd442babdc33122c7b2c30b91e204e597fd38e547ccf62c3e6881d78d1a2b2005581d27dcad1177b1d64ae066d2bfbafabe89cb5
|
7
|
+
data.tar.gz: 2047c647afe7e4a9b373997184bde9c1a84e47e410571531266fc60075a99da1a65ec4de685c6e79fd852e7de61af427a40440e317ad8a13014a8cc4ccd4f372
|
data/.github/workflows/tests.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.4.2
|
data/Gemfile.lock
CHANGED
data/lib/money/helpers.rb
CHANGED
data/lib/money/version.rb
CHANGED
data/spec/money_spec.rb
CHANGED
@@ -457,6 +457,12 @@ RSpec.describe "Money" do
|
|
457
457
|
expect(Money.from_subunits(100, 'UGX', format: :stripe)).to eq(Money.new(1, 'UGX'))
|
458
458
|
end
|
459
459
|
|
460
|
+
it 'overrides the subunit_to_unit amount for USDC' do
|
461
|
+
configure(experimental_crypto_currencies: true) do
|
462
|
+
expect(Money.from_subunits(500000, "USDC", format: :stripe)).to eq(Money.new(0.50, 'USDC'))
|
463
|
+
end
|
464
|
+
end
|
465
|
+
|
460
466
|
it 'fallbacks to the default subunit_to_unit amount if no override is specified' do
|
461
467
|
expect(Money.from_subunits(100, 'USD', format: :stripe)).to eq(Money.new(1, 'USD'))
|
462
468
|
end
|
data/spec/splitter_spec.rb
CHANGED
@@ -48,6 +48,12 @@ RSpec.describe "Money::Splitter" do
|
|
48
48
|
expect(moneys[2].value).to eq(33)
|
49
49
|
end
|
50
50
|
|
51
|
+
specify "#spit results behaves like an array" do
|
52
|
+
moneys = Money.new(100, 'JPY').split(3)
|
53
|
+
expect(moneys.size).to eq(3)
|
54
|
+
expect(moneys[3]).to eq(nil)
|
55
|
+
end
|
56
|
+
|
51
57
|
specify "#split return respond to #first" do
|
52
58
|
expect(Money.new(100).split(3).first).to eq(Money.new(33.34))
|
53
59
|
expect(Money.new(100).split(3).first(2)).to eq([Money.new(33.34), Money.new(33.33)])
|