Sha256: a876191ad813a0efbf0400364477f30de137979d555d1aaf30ef1dbf8008d53b
Contents?: true
Size: 1.8 KB
Versions: 6
Compression:
Stored size: 1.8 KB
Contents
# frozen_string_literal: true require 'test_helper' module Vedeu class PresentationParentTestClass include Vedeu::Presentation::Parent def initialize(attributes = {}) @colour = attributes[:colour] @name = attributes[:name] @parent = attributes[:parent] end end # PresentationParentTestClass module Presentation describe Parent do let(:described) { Vedeu::Presentation::Parent } let(:included_described) { Vedeu::PresentationParentTestClass } let(:included_instance) { included_described.new(attributes) } let(:parent) { Vedeu::PresentationParentTestClass.new } let(:_name) { :vedeu_presentation_parent } let(:attributes) { { name: _name, parent: parent, } } describe '#name' do subject { included_instance.name } context 'when a name is set' do it { subject.must_equal(_name) } end context 'when a name is not set' do let(:_name) {} # context 'when a parent name is set' do # it { subject.must_equal('Vedeu::Line') } # end context 'when a parent name is not set' do let(:parent) {} it { subject.must_equal(nil) } end end end describe '#parent' do it { included_instance.must_respond_to(:parent) } end describe '#parent?' do subject { included_instance.parent? } context 'when the parent attribute is set' do it { subject.must_equal(true) } end context 'when the parent attribute is not set' do let(:parent) {} it { subject.must_equal(false) } end end end # Parent end # Presentation end # Vedeu
Version data entries
6 entries across 6 versions & 1 rubygems