Sha256: cb82f88e176e011e33164ce4a2ed7e531614b6ff06375adf83931397c81b90c2

Contents?: true

Size: 845 Bytes

Versions: 35

Compression:

Stored size: 845 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'spree/core/environment_extension'

class DummyClass
  include Spree::Core::EnvironmentExtension
end

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

RSpec.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

35 entries across 35 versions & 2 rubygems

Version Path
solidus_core-2.8.6 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.6.6 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.7.4 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.8.5 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.7.3 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.6.5 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.9.0.rc.1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.8.4 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.8.3 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.7.2 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.6.4 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.8.2 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.8.1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.6.3 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.8.0 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.7.1 spec/lib/spree/core/environment_extension_spec.rb
solidus_core-2.6.2 spec/lib/spree/core/environment_extension_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.14 spec/lib/spree/core/environment_extension_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.13 spec/lib/spree/core/environment_extension_spec.rb
solidus_core_devise_token_auth-2.8.0.alpha.12 spec/lib/spree/core/environment_extension_spec.rb