klarna-checkout 1.0.0 → 1.0.1

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: 9914fd9513d48a6790d8b25e13dd7756f9c93c2b
4
- data.tar.gz: eb20429a1354aa9048a5d1679423440e60e4f1d6
3
+ metadata.gz: 6f200d016d1077f2b5b3ebc5f0c86d159026bba2
4
+ data.tar.gz: e67d945dd337c79bc009dc81f567eb019cd6824f
5
5
  SHA512:
6
- metadata.gz: 3accb156ce11c9374f0c165e67655fc6ebbe6b8682b856a334ed21e5d2bc0fcee6f488400835039431720f231295bc04361b336083100aa561dc834933da33ff
7
- data.tar.gz: cb4b551025ed2fc86f2dbd8b5d8ab283c3dd65a58eb2aee9eb494bac6ba3b108e92c880dec6ea439aeb5c009a2584fe1e0278568a7f1f3ebadeaafde6d49f286
6
+ metadata.gz: b761e05e33fc91e2535a89b9c9eb9913873e50ed65d99fe38388bd90677b608f77249b2e1651b4a343bc27683495d9e4ab7dd6bc833163e28de637c6131cd1bd
7
+ data.tar.gz: d482de6c343129e429961d8876be3ab3fadc07988892c373ba1c49901e3754ce728ab447e26e23214cca6baf77d2213f162767d877639ccb4c42686f3bd303de
@@ -5,6 +5,12 @@ module HasMany
5
5
  define_method "#{association}=" do |new_value|
6
6
  new_value = Array(new_value)
7
7
  inst_var = "@#{association}"
8
+
9
+ if new_value.empty?
10
+ instance_variable_set(inst_var, [])
11
+ return
12
+ end
13
+
8
14
  case new_value.first
9
15
  when klass
10
16
  instance_variable_set(inst_var, new_value)
@@ -1,5 +1,5 @@
1
1
  module Klarna
2
2
  module Checkout
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -11,6 +11,14 @@ describe Klarna::Checkout::Cart do
11
11
  it { should have_many(:items, as: Klarna::Checkout::CartItem) }
12
12
  end
13
13
 
14
+ describe "emptying the cart" do
15
+ before(:each) do
16
+ subject.items = []
17
+ end
18
+
19
+ its(:items) { should eq [] }
20
+ end
21
+
14
22
  describe "#as_json" do
15
23
  let(:cart) do
16
24
  described_class.new \
@@ -1,5 +1,5 @@
1
1
  require 'klarna/checkout/version'
2
2
 
3
3
  describe Klarna::Checkout::VERSION do
4
- it { should eq '1.0.0' }
4
+ it { should eq '1.0.1' }
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klarna-checkout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theodor Tonum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-10 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday