Sha256: 78e5066b4c635164b3fb0ab6f7ebf4a700dd78685933f81c0b455adcb483cd36

Contents?: true

Size: 694 Bytes

Versions: 4

Compression:

Stored size: 694 Bytes

Contents

require 'test_helper'
require 'vedeu/output/template'

module Vedeu
  describe Template do
    describe '#parse' do
      object = OpenStruct.new(value: 'Hello from variable!')

      it 'parses the template when the template file was found' do
        path   = '/../../../test/support/template.erb'
        Template.new(object, path).parse.must_match(/This is the test template/)
        Template.new(object, path).parse.must_match(/Hello from variable!/)
      end

      it 'raises an exception when the template file cannot be found' do
        path   = '/some/wrong/path/template.erb'
        proc { Template.new(object, path).parse }.must_raise(Errno::ENOENT)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vedeu-0.1.0 test/lib/vedeu/output/template.rb
vedeu-0.0.42 test/lib/vedeu/output/template.rb
vedeu-0.0.41 test/lib/vedeu/output/template.rb
vedeu-0.0.40 test/lib/vedeu/output/template.rb