Sha256: 88ea9bc4702fd406081c3654f50c35c61719618bb1eea5e58ad29093e41ae2a9

Contents?: true

Size: 541 Bytes

Versions: 2

Compression:

Stored size: 541 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 }

  context 'with an Array object' do
    let(:value) { %w[a] }

    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
      subject.select(&:frozen?).should == subject
    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/array/class_methods/deep_freeze_spec.rb
ice_nine-0.7.0 spec/unit/ice_nine/freezer/array/class_methods/deep_freeze_spec.rb