Sha256: 518560bbd9f45701cb47d836de9763b5bba6a74b749b98041e95818480fc6404

Contents?: true

Size: 765 Bytes

Versions: 31

Compression:

Stored size: 765 Bytes

Contents

require 'spec_helper'

class DummyClass
  include Spree::Core::EnvironmentExtension
end

class C1; end
class C2; end
class C3; end

describe Spree::Core::EnvironmentExtension do
  subject { DummyClass.new }

  before { subject.add_class('random_name') }

  describe 'Basis' do
    it { respond_to?(:random_name) }
    it { respond_to?(:random_name=) }
  end

  describe '#getter' do
    it { expect(subject.random_name).to be_empty }
    it { expect(subject.random_name).to be_kind_of Spree::Core::ClassConstantizer::Set }
  end

  describe '#setter' do
    before { subject.random_name = [C1, C2]; @set = subject.random_name.to_a }

    it { expect(@set).to include(C1) }
    it { expect(@set).to include(C2) }
    it { expect(@set).not_to include(C3) }
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
solidus_core-2.3.1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.2.2 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.1.1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.0.3 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-1.4.2 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-1.3.2 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.3.0 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.3.0.rc3 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.3.0.rc2 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.3.0.rc1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.3.0.beta1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.0.2 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-1.4.1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.2.1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.2.0 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.2.0.rc1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.2.0.beta1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.1.0 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.1.0.rc1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.0.1 spec/lib/spree/core/environment_extension_spec.rb