require 'test_helper' module Vedeu describe HTMLChar do let(:described) { Vedeu::HTMLChar } let(:instance) { described.new(char) } let(:char) { Vedeu::Char.new(attributes) } let(:attributes) { { border: border, colour: colour, parent: parent, value: value } } let(:border) {} let(:colour) {} let(:parent) { Vedeu::Line.new({ colour: parent_colour }) } let(:parent_colour) {} let(:value) {} describe '#initialize' do it { instance.must_be_instance_of(Vedeu::HTMLChar) } it { instance.instance_variable_get('@char').must_equal(char) } end describe '.render' do subject { described.render(char) } it { subject.must_be_instance_of(String) } context 'when there is a border' do let(:border) { :top_left } context 'when there is a colour' do let(:colour) { Vedeu::Colour.new({ background: '#220022', foreground: '#aadd00' }) } it { subject.must_equal( "