Sha256: 488b43443d2dd40faf1cd96dcb0b085f13da40551de529fffc559017a8a12e9f
Contents?: true
Size: 1.42 KB
Versions: 8
Compression:
Stored size: 1.42 KB
Contents
require 'spec_helper' describe Virtus::Attribute::EmbeddedValue, '.build' do subject { described_class.build(type) } context 'when type is a Virtus.model' do let(:type) { Class.new { include Virtus.model } } it { should be_frozen } it { should be_instance_of(Virtus::Attribute::EmbeddedValue) } its(:coercer) { should be_instance_of(described_class::FromOpenStruct) } end context 'when type includes Virtus' do let(:type) { Class.new { include Virtus } } it { should be_frozen } it { should be_instance_of(Virtus::Attribute::EmbeddedValue) } its(:coercer) { should be_instance_of(described_class::FromOpenStruct) } end context 'when type is an OpenStruct subclass' do let(:type) { Class.new(OpenStruct) } it { should be_frozen } it { should be_instance_of(Virtus::Attribute::EmbeddedValue) } its(:coercer) { should be_instance_of(described_class::FromOpenStruct) } end context 'when type is OpenStruct' do let(:type) { OpenStruct } it { should be_frozen } it { should be_instance_of(Virtus::Attribute::EmbeddedValue) } its(:coercer) { should be_instance_of(described_class::FromOpenStruct) } end context 'when type is Struct' do let(:type) { Struct.new(:test) } it { should be_frozen } it { should be_instance_of(Virtus::Attribute::EmbeddedValue) } its(:coercer) { should be_instance_of(described_class::FromStruct) } end end
Version data entries
8 entries across 8 versions & 1 rubygems