Sha256: 3d134db2789c8da67a5160d5384ad2a03e024dca4f5789075b45ea9dd38e565f
Contents?: true
Size: 881 Bytes
Versions: 1
Compression:
Stored size: 881 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Immutable, '.freeze_object' do subject { object.freeze_object(value) } let(:object) { self.class.described_type } context 'with a numeric value' do let(:value) { 1 } it { should equal(value) } end context 'with a true value' do let(:value) { true } it { should equal(value) } end context 'with a false value' do let(:value) { false } it { should equal(value) } end context 'with a nil value' do let(:value) { nil } it { should equal(value) } end context 'with a frozen value' do let(:value) { String.new.freeze } it { should equal(value) } end context 'with an unfrozen value' do let(:value) { String.new } it { should_not equal(value) } it { should be_kind_of(String) } it { should == value } it { should be_frozen } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
veritas-0.0.4 | spec/unit/veritas/immutable/class_methods/freeze_object_spec.rb |