Sha256: 2d109d3cde6867f5ef3fce076c0c5d803b6fcc43da0dc957e2d1a3883876cbeb
Contents?: true
Size: 872 Bytes
Versions: 1
Compression:
Stored size: 872 Bytes
Contents
# encoding: utf-8 require 'spec_helper' require 'ice_nine' describe IceNine::Freezer::Array, '.deep_freeze' do subject { object.deep_freeze(value) } let(:object) { described_class } shared_examples 'IceNine::Freezer::Array.deep_freeze' do 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 each entry in the Array' do expect(subject.select(&:frozen?)).to eql(subject) end end context 'with an Array object' do let(:value) { %w[a] } context 'without a circular reference' do it_behaves_like 'IceNine::Freezer::Array.deep_freeze' end context 'with a circular reference' do before { value << value } it_behaves_like 'IceNine::Freezer::Array.deep_freeze' end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ice_nine-0.10.0 | spec/unit/ice_nine/freezer/array/class_methods/deep_freeze_spec.rb |