Sha256: 2a04ac64f882b3f8ab51e87ce64d965d9f59612d82157b1b857b67009e4ea399
Contents?: true
Size: 1.12 KB
Versions: 2
Compression:
Stored size: 1.12 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Adamantium::Freezer::Flat, '.call' do subject { object.call(value) } let(:object) { described_class } 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 symbol value' do let(:value) { :symbol } 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_instance_of(String) } it { should eql(value) } it { should be_frozen } end context 'with a composed value' do let(:value) { [String.new] } it 'does NOT freeze inner values' do expect(subject.first).to_not be_frozen end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
adamantium-0.2.0 | spec/unit/adamantium/freezer/flat/class_methods/call_spec.rb |
adamantium-0.1.0 | spec/unit/adamantium/freezer/flat/class_methods/call_spec.rb |