Sha256: f1d10523d12fac7cc64e77da29f1bd48b180754cd5edeafe37b5c78fafb58f92

Contents?: true

Size: 624 Bytes

Versions: 2

Compression:

Stored size: 624 Bytes

Contents

# encoding: utf-8

require 'spec_helper'
require 'ice_nine'

describe IceNine::Freezer::Object, '.deep_freeze' do
  subject { object.deep_freeze(value) }

  let(:object) { described_class }

  context 'with an Object' do
    let(:value) { Object.new }

    before do
      value.instance_eval { @a = '1' }
    end

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

    it 'freezes the object' do
      expect { subject }.to change(value, :frozen?).from(false).to(true)
    end

    it 'freezes the instance variables in the Object' do
      subject.instance_variable_get(:@a).should be_frozen
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ice_nine-0.8.0 spec/unit/ice_nine/freezer/object/class_methods/deep_freeze_spec.rb
ice_nine-0.7.0 spec/unit/ice_nine/freezer/object/class_methods/deep_freeze_spec.rb