Sha256: 352ff6a852386ec36fd097bc33668494d041a5108a03c0bf82b60dae580801fe
Contents?: true
Size: 1.69 KB
Versions: 22
Compression:
Stored size: 1.69 KB
Contents
require 'test_helper' module Vedeu class ParentPresentationStyleTestClass include Vedeu::Presentation attr_reader :attributes attr_reader :parent def attributes { style: ['underline'] } end end class PresentationStyleTestClass include Vedeu::Presentation attr_reader :attributes attr_reader :parent def initialize(attributes = {}) @attributes = attributes @parent = @attributes[:parent] end end # PresentationTestClass module Presentation describe Styles do let(:includer) { Vedeu::PresentationStyleTestClass.new(attributes) } let(:attributes) { { parent: parent, style: style, } } let(:parent) { Vedeu::ParentPresentationStyleTestClass.new } let(:style) { ['bold'] } describe '#style' do subject { includer.style } it { subject.must_be_instance_of(Vedeu::Presentation::Style) } context 'when the attribute is not set' do let(:style) {} context 'when a parent is available' do it { subject.value.must_equal(['underline']) } end context 'when a parent is not available' do let(:parent) {} it { subject.value.must_equal(nil) } end end context 'when the attribute is set' do it { subject.value.must_equal(['bold']) } end end describe '#style=' do let(:style) { Vedeu::Presentation::Style.new('normal') } subject { includer.style = (style) } it { subject.must_be_instance_of(Vedeu::Presentation::Style) } end end # Style end # Presentation end # Vedeu
Version data entries
22 entries across 22 versions & 1 rubygems