Sha256: 0cfb897c73a7dcda58bd6c3bfb19cb3c244f4c466ae175f48cee7c4314304147
Contents?: true
Size: 667 Bytes
Versions: 12
Compression:
Stored size: 667 Bytes
Contents
require 'spec_helper' describe Virtus::Attribute, '#set' do subject { object.set(instance, value) } let(:object) { described_class.build(String, options.merge(:name => name)) } let(:model) { Class.new { attr_reader :test } } let(:name) { :test } let(:instance) { model.new } let(:value) { 'Jane Doe' } let(:options) { {} } it { should be(value) } context 'without coercion' do specify do expect { subject }.to change { instance.test }.to(value) end end context 'with coercion' do let(:value) { :'Jane Doe' } specify do expect { subject }.to change { instance.test }.to('Jane Doe') end end end
Version data entries
12 entries across 12 versions & 1 rubygems