gems.virtus-1.0.5.spec.unit.virtus.element_writer_spec.rb Maven / Gradle / Ivy
The newest version!
require 'spec_helper'
describe Virtus, '#[]=' do
subject { object[:test] = 'foo' }
let(:model) {
Class.new {
include Virtus
attribute :test, String
}
}
let(:object) { model.new }
specify do
expect { subject }.to change { object.test }.from(nil).to('foo')
end
end