Sha256: a86ce74c622e6796e589811e2c3ef4ed483ca068e2fef853698255eb867a3df4
Contents?: true
Size: 1.03 KB
Versions: 10
Compression:
Stored size: 1.03 KB
Contents
require "#{File.dirname(__FILE__)}/../../spec_helper" shared_examples_for 'a keyworded model' do # clazz must be defined by the calling file let(:model) { clazz.new } it 'has a keyword' do expect(model).to respond_to(:keyword) end it 'can change its keyword' do expect(model).to respond_to(:keyword=) model.keyword = :some_keyword expect(model.keyword).to eq(:some_keyword) model.keyword = :some_other_keyword expect(model.keyword).to eq(:some_other_keyword) end describe 'abstract instantiation' do context 'a new object' do let(:model) { clazz.new } it 'starts with no keyword' do expect(model.keyword).to be_nil end end end describe 'model output' do context 'from abstract instantiation' do let(:model) { clazz.new } it 'can output a model that has only a keyword' do model.keyword = 'foo' expect { model.to_s }.to_not raise_error end end end end
Version data entries
10 entries across 10 versions & 1 rubygems