Sha256: da5ea34e67270de287d9955fe4791dd9230a87ed706f91c6ad3e01928313c17e
Contents?: true
Size: 755 Bytes
Versions: 5
Compression:
Stored size: 755 Bytes
Contents
# frozen_string_literal: true 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 attr_reader :age private attr_writer :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
5 entries across 5 versions & 1 rubygems