Sha256: d3d0f404e2750a9651712fd70162000e581b93e66b55196c6ad309f0201f5b33
Contents?: true
Size: 1.03 KB
Versions: 16
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' class Document include CouchPotato::Persistence property :title property :content end describe 'new' do context 'without arguments' do subject { Document.new } it { is_expected.to be_a(Document) } it 'has no title' do expect(subject.title).to be_nil end it 'has no content' do expect(subject.content).to be_nil end end context 'with an argument hash' do subject { Document.new(title: 'My Title') } it { is_expected.to be_a(Document) } it 'has a title' do expect(subject.title).to eql('My Title') end it 'has no content' do expect(subject.content).to be_nil end end context 'yielding to a block' do subject do Document.new(title: 'My Title') do |doc| doc.content = 'My Content' end end it { is_expected.to be_a(Document) } it 'has a title' do expect(subject.title).to eql('My Title') end it 'has a content' do expect(subject.content).to eql('My Content') end end end
Version data entries
16 entries across 16 versions & 1 rubygems