solidus_core 1.2.0.rc1 → 1.2.0.rc2

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.

Potentially problematic release.


This version of solidus_core might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef1fda7b796bd51ab9e01a449e5354a21efee3b9
4
- data.tar.gz: c6a7a3dd7d508844576f5070ec54d05f491f229d
3
+ metadata.gz: 82876c2eaf3d0b1300b8c2d0903d872a5e214d0a
4
+ data.tar.gz: efacf0ca0cc2faa62b4e67082a2633505640fec9
5
5
  SHA512:
6
- metadata.gz: 579a5e3d9ab4ab281a4ffffac65d98d68069b965d0435908033dd492b5e0d26456ca26a90c033a8ce043a53a456052556a1f2ac713d33334c93688163dd4db88
7
- data.tar.gz: 432c5b1f58a716abe1d8eac31b2028e7d748ecae28330800e5b6a186749b15d36cc2acee1b7622c9437918417d7fa9fbb830c5d46527ea3a1f4199a53855aff2
6
+ metadata.gz: 011b1113b9957d987204f53c39658fe8cbb33b9b2de60c96034b7fcac038a209a0b8df568b13d77b5866e2d76691ff44f9cb693957ebe792e738cc7aaab51118
7
+ data.tar.gz: 2256f27042f878a46bc89cea319e8cec4359a085d82b50ab27a406fcbbc96237b199818e046bd3ff16e24ddee2df805c3e74ac94e98f58302a69d8de9ddd3e94
@@ -17,7 +17,6 @@
17
17
  #
18
18
  require "spree/core/search/base"
19
19
  require "spree/core/search/variant"
20
- require 'spree/core/stock_configuration'
21
20
 
22
21
  module Spree
23
22
  class AppConfiguration < Preferences::Configuration
@@ -313,7 +312,7 @@ module Spree
313
312
  end
314
313
 
315
314
  def stock
316
- Spree::StockConfiguration
315
+ @stock_configuration ||= Spree::Core::StockConfiguration.new
317
316
  end
318
317
 
319
318
  # all the following can be deprecated when store prefs are no longer supported
data/lib/spree/core.rb CHANGED
@@ -92,6 +92,7 @@ require 'spree/core/controller_helpers/store'
92
92
  require 'spree/core/controller_helpers/strong_parameters'
93
93
  require 'spree/core/unreturned_item_charger'
94
94
  require 'spree/core/role_configuration'
95
+ require 'spree/core/stock_configuration'
95
96
  require 'spree/permission_sets'
96
97
  require 'spree/deprecation'
97
98
 
@@ -1,11 +1,12 @@
1
1
  module Spree
2
- module StockConfiguration
3
- mattr_accessor :estimator_class do
4
- '::Spree::Stock::Estimator'
5
- end
2
+ module Core
3
+ class StockConfiguration
4
+ attr_writer :estimator_class
6
5
 
7
- def self.estimator_class
8
- @@estimator_class.constantize
6
+ def estimator_class
7
+ @estimator_class ||= '::Spree::Stock::Estimator'
8
+ @estimator_class.constantize
9
+ end
9
10
  end
10
11
  end
11
12
  end
@@ -5,7 +5,7 @@ module Spree
5
5
  end
6
6
 
7
7
  def self.solidus_version
8
- "1.2.0.rc1"
8
+ "1.2.0.rc2"
9
9
  end
10
10
 
11
11
  def self.solidus_gem_version
@@ -1,16 +1,21 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe Spree::StockConfiguration do
4
- before(:all) { @estimator_class = described_class.estimator_class.to_s }
5
- after(:all) { described_class.estimator_class = @estimator_class }
3
+ RSpec.describe Spree::Core::StockConfiguration do
4
+ describe '#estimator_class' do
5
+ let(:stock_configuration) { described_class.new }
6
+ subject { stock_configuration.estimator_class }
6
7
 
7
- describe '.estimator_class' do
8
- subject { described_class.estimator_class }
9
- let(:foo) { Struct.new :foo }
8
+ it "returns Spree::Stock::Estimator" do
9
+ is_expected.to be ::Spree::Stock::Estimator
10
+ end
10
11
 
11
- before { described_class.estimator_class = 'Foo' }
12
- before { Foo = foo }
12
+ context "with another constant name assiged" do
13
+ MyEstimator = Class.new
14
+ before { stock_configuration.estimator_class = MyEstimator.to_s }
13
15
 
14
- it { is_expected.to eq foo }
16
+ it "returns the constant" do
17
+ is_expected.to be MyEstimator
18
+ end
19
+ end
15
20
  end
16
21
  end
@@ -23,6 +23,6 @@ describe Spree::AppConfiguration, :type => :model do
23
23
 
24
24
  describe '#stock' do
25
25
  subject { prefs.stock }
26
- it { is_expected.to eq Spree::StockConfiguration }
26
+ it { is_expected.to be_a Spree::Core::StockConfiguration }
27
27
  end
28
28
  end
@@ -208,7 +208,7 @@ describe Spree::Shipment, type: :model do
208
208
  end
209
209
 
210
210
  it 'uses the pluggable estimator class' do
211
- expect(Spree::StockConfiguration).to receive(:estimator_class).and_call_original
211
+ expect(Spree::Config.stock).to receive(:estimator_class).and_call_original
212
212
  shipment.refresh_rates
213
213
  end
214
214
 
@@ -18,7 +18,7 @@ module Spree
18
18
  end
19
19
 
20
20
  it 'uses the pluggable estimator class' do
21
- expect(Spree::StockConfiguration).to receive(:estimator_class).and_call_original
21
+ expect(Spree::Config.stock).to receive(:estimator_class).and_call_original
22
22
  subject.packages
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.rc1
4
+ version: 1.2.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-15 00:00:00.000000000 Z
11
+ date: 2016-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant