Sha256: fb70b4eeaa1099b591741960aac40f3fac8904badaeeefdc7051d63a70857d44

Contents?: true

Size: 680 Bytes

Versions: 9

Compression:

Stored size: 680 Bytes

Contents

require_relative '../../../test_helper'

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

9 entries across 9 versions & 1 rubygems

Version Path
vedeu-0.0.39 test/lib/vedeu/output/template.rb
vedeu-0.0.38 test/lib/vedeu/output/template.rb
vedeu-0.0.37 test/lib/vedeu/output/template.rb
vedeu-0.0.36 test/lib/vedeu/output/template.rb
vedeu-0.0.35 test/lib/vedeu/output/template.rb
vedeu-0.0.34 test/lib/vedeu/output/template.rb
vedeu-0.0.33 test/lib/vedeu/output/template.rb
vedeu-0.0.32 test/lib/vedeu/output/template.rb
vedeu-0.0.31 test/lib/vedeu/output/template.rb