Sha256: 2078fbac7318c70fea319f7cbf27b776c73bc924f348cebadbf966eb56caffa0
Contents?: true
Size: 1.5 KB
Versions: 3
Compression:
Stored size: 1.5 KB
Contents
require_relative '../../../test_helper' require_relative '../../../../lib/vedeu/output/text_adaptor' module Vedeu describe TextAdaptor do let(:described_class) { TextAdaptor } let(:text) { '' } describe '#initialize' do let(:subject) { described_class.new(text) } it 'returns an TextAdaptor instance' do subject.must_be_instance_of(TextAdaptor) end it 'sets an instance variable' do subject.instance_variable_get('@text').must_equal(text) end end describe '.adapt' do let(:subject) { described_class.adapt(text) } it 'returns an Array' do subject.must_be_instance_of(Array) end context 'when processing an empty string' do let(:text) { '' } it 'returns an empty collection' do subject.must_be_empty end end context 'when processing a single line' do let(:text) { "This is a single line of text.\n" } it 'returns a collection of Line objects' do subject.first.must_be_instance_of(Line) subject.size.must_equal(1) end end context 'when processing multiple lines' do let(:text) { "Lorem ipsum dolor sit amet,\nConseactetur adipiscing.\n" \ "Curabitur aliquet, turpis id dui.\n\nConditum elemum.\n" } it 'returns a collection of Line objects' do subject.first.must_be_instance_of(Line) subject.size.must_equal(5) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.0.30 | test/lib/vedeu/output/text_adaptor_test.rb |
vedeu-0.0.29 | test/lib/vedeu/output/text_adaptor_test.rb |
vedeu-0.0.28 | test/lib/vedeu/output/text_adaptor_test.rb |