test/lib/vedeu/templating/preprocessor_test.rb in vedeu-0.4.52 vs test/lib/vedeu/templating/preprocessor_test.rb in vedeu-0.4.53
- old
+ new
@@ -13,29 +13,30 @@
"Some text here\n",
"{{ colour(foreground: '#0f0') { 'Yay!' } }}\n",
"More text here\n"
]
}
+ 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')
+ ]
+ }
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) }
+ subject { described.process(lines) }
+
+ it { subject.must_equal(expected) }
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