Sha256: a58d660d240a59ed37a18c6421dac6fdd58fc27bcb3a2371ebb944d678af66f7
Contents?: true
Size: 684 Bytes
Versions: 25
Compression:
Stored size: 684 Bytes
Contents
require 'spec_helper' describe 'Acfs::Resource::Initialization' do let(:model) do Class.new(Acfs::Resource).tap do |c| c.class_eval do attr_accessor :name, :age private :age= end end end describe '#initialize' do it 'should allow to set attributes with initializer' do m = model.new name: 'John' expect(m.name).to eq 'John' end it 'should raise error when attributes with private setters are given' do expect { model.new age: 25 }.to raise_error(NoMethodError) end end describe '#persisted?' do subject { model.new.persisted? } it 'should be false' do should be false end end end
Version data entries
25 entries across 25 versions & 1 rubygems