|
9 | 9 |
|
10 | 10 | describe '#initialize' do |
11 | 11 | subject do |
12 | | - Spree::Deprecation.silence do |
13 | | - described_class.new(amount, currency: currency, with_currency: true).to_s |
14 | | - end |
| 12 | + described_class.new(amount, currency: currency, with_currency: true).to_s |
15 | 13 | end |
16 | 14 |
|
17 | 15 | context 'with no currency' do |
|
39 | 37 | it { should == "$10.00 USD" } |
40 | 38 | end |
41 | 39 |
|
42 | | - context "with symbol" do |
43 | | - let(:amount){ '$10.00' } |
44 | | - it { should == "$10.00 USD" } |
45 | | - end |
46 | | - |
47 | | - context "with extra currency" do |
48 | | - let(:amount){ '$10.00 USD' } |
49 | | - it { should == "$10.00 USD" } |
50 | | - end |
51 | | - |
52 | | - context "with different currency" do |
53 | | - let(:currency){ 'USD' } |
54 | | - let(:amount){ '$10.00 CAD' } |
55 | | - it { should == "$10.00 CAD" } |
56 | | - end |
57 | | - |
58 | | - context "with commas" do |
59 | | - let(:amount){ '1,000.00' } |
60 | | - it { should == "$1,000.00 USD" } |
61 | | - end |
62 | | - |
63 | | - context "with comma for decimal point" do |
64 | | - let(:amount){ '10,00' } |
65 | | - it { should == "$10.00 USD" } |
| 40 | + context 'with deprecated amount format' do |
| 41 | + before do |
| 42 | + expect(Spree::Deprecation).to receive(:warn). |
| 43 | + with(/^Spree::Money was initialized with ".*", which will not be supported in the future/, any_args) |
| 44 | + end |
| 45 | + |
| 46 | + context "with symbol" do |
| 47 | + let(:amount){ '$10.00' } |
| 48 | + it { should == "$10.00 USD" } |
| 49 | + end |
| 50 | + |
| 51 | + context "with extra currency" do |
| 52 | + let(:amount){ '$10.00 USD' } |
| 53 | + it { should == "$10.00 USD" } |
| 54 | + end |
| 55 | + |
| 56 | + context "with different currency" do |
| 57 | + let(:currency){ 'USD' } |
| 58 | + let(:amount){ '$10.00 CAD' } |
| 59 | + it { should == "$10.00 CAD" } |
| 60 | + end |
| 61 | + |
| 62 | + context "with commas" do |
| 63 | + let(:amount){ '1,000.00' } |
| 64 | + it { should == "$1,000.00 USD" } |
| 65 | + end |
| 66 | + |
| 67 | + context "with comma for decimal point" do |
| 68 | + let(:amount){ '10,00' } |
| 69 | + it { should == "$10.00 USD" } |
| 70 | + end |
66 | 71 | end |
67 | 72 |
|
68 | 73 | context 'with fixnum' do |
|
0 commit comments