Sha256: eb8640e47789aa516494a0fd17b64eb34da4a54ef1fa749d7eb0ef388203c42e

Contents?: true

Size: 802 Bytes

Versions: 6

Compression:

Stored size: 802 Bytes

Contents

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

module Troo
  describe Template do
    let(:described_class) { Template }
    let(:object)          { stub(value: 'Hello from variable!') }
    let(:path)            { '/../../../test/support/template.erb' }

    describe '#parse' do
      subject { described_class.new(object, path).parse }

      context 'when the template file can be found' do
        it 'parses the template' do
          subject.must_match(/This is the test template/)
          subject.must_match(/Hello from variable!/)
        end
      end

      context 'when the template file cannot be found' do
        let(:path) { '/some/wrong/path/template.erb' }

        it 'raises an exception' do
          proc { subject }.must_raise(Errno::ENOENT)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
troo-0.0.15 test/lib/troo/presentation/template_test.rb
troo-0.0.14 test/lib/troo/presentation/template_test.rb
troo-0.0.13 test/lib/troo/presentation/template_test.rb
troo-0.0.12 test/lib/troo/presentation/template_test.rb
troo-0.0.11 test/lib/troo/presentation/template_test.rb
troo-0.0.10 test/lib/troo/presentation/template_test.rb