Sha256: 12bb6a247d6c20388ee14561c88103ef73732e59fbd8fcd7ba4c60d1adc3de23

Contents?: true

Size: 507 Bytes

Versions: 11

Compression:

Stored size: 507 Bytes

Contents

# encoding: utf-8

shared_examples 'IceNine::Freezer::NoFreeze.deep_freeze' do
  before do
    value.instance_eval { @a = '1' } unless value.frozen?
  end

  it 'returns the object' do
    should be(value)
  end

  it 'does not freeze the object' do
    expect { subject }.to_not change(value, :frozen?).from(value.frozen?)
  end

  it 'does not freeze instance variables' do
    if subject.instance_variable_defined?(:@a)
      expect(subject.instance_variable_get(:@a)).to_not be_frozen
    end
  end
end

Version data entries

11 entries across 9 versions & 4 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/ice_nine-0.11.2/spec/shared/no_freeze_deep_freeze.rb
ice_nine-0.11.2 spec/shared/no_freeze_deep_freeze.rb
ice_nine-0.11.1 spec/shared/no_freeze_deep_freeze.rb