Sha256: 7bad6d055eef98a25a3dc4541c32c255bf73af687cf6bd5e0f922576cdcd8cc3
Contents?: true
Size: 1.08 KB
Versions: 25
Compression:
Stored size: 1.08 KB
Contents
require 'test_helper' module Vedeu module Templating describe Preprocessor do let(:described) { Vedeu::Templating::Preprocessor } let(:instance) { described.new(lines) } let(:lines) { [ "Some text here\n", "{{ colour(foreground: '#0f0') { 'Yay!' } }}\n", "More text here\n" ] } describe '#initialize' do it { instance.must_be_instance_of(described) } it { instance.instance_variable_get('@lines').must_equal(lines) } end describe '.process' do it { described.must_respond_to(:process) } end describe '#process' do let(:expected) { [ Vedeu::Stream.new(value: 'Some text here'), Vedeu::Stream.new(value: 'Yay!', colour: Vedeu::Colour.coerce({ foreground: '#0f0' })), Vedeu::Stream.new(value: 'More text here') ] } subject { instance.process } it { subject.must_equal(expected) } end end # Preprocessor end # Templating end # Vedeu
Version data entries
25 entries across 25 versions & 1 rubygems