Sha256: 6bb8b0be5a15949ce9c80ce8605440e44bbe7ac1a31c5fd3addc9fa44f14c2c2

Contents?: true

Size: 620 Bytes

Versions: 2

Compression:

Stored size: 620 Bytes

Contents

# encoding: utf-8

require 'spec_helper'
require 'ice_nine'

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

  let(:object) { described_class }

  context 'with a Range' do
    let(:value) { 'a'..'z' }

    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 'freeze the first object in the Range' do
      subject.begin.should be_frozen
    end

    it 'freeze the last object in the Range' do
      subject.end.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/range/class_methods/deep_freeze_spec.rb
ice_nine-0.7.0 spec/unit/ice_nine/freezer/range/class_methods/deep_freeze_spec.rb