Sha256: 3c5ec69d5376bc652589e982877f9689337486ff4eff298278ac18bfcc8f3efb
Contents?: true
Size: 1.2 KB
Versions: 64
Compression:
Stored size: 1.2 KB
Contents
RSpec.shared_examples 'a publishable object' do describe '#publishable?' do let(:object) { described_class.new } it 'should be publishable' do expect(object.publishable?).to be true end end end RSpec.shared_examples 'an unpublishable object' do describe '#publishable?' do let(:object) { described_class.new } it 'should not be publishable' do expect(object.publishable?).to be false end end end RSpec.shared_examples 'a potentially publishable object' do describe "#publishable?" do let(:object) { described_class.new } context "has parent" do before { allow(object).to receive(:parent) { parent } } context "parent is published" do let(:parent) { double(published?: true) } it "should be publishable" do expect(object.publishable?).to be true end end context "parent is not published" do let(:parent) { double(published?: false) } it "should not be publishable" do expect(object.publishable?).to be false end end end context "does not have parent" do it "should not be publishable" do expect(object.publishable?).to be false end end end end
Version data entries
64 entries across 64 versions & 1 rubygems