![Gibheer](/assets/img/avatar_default.png)
The template finder is now the instance to ask for templates. It was already looking for them, so it should be able to handle questions regarding the existence of templates too.
16 lines
458 B
Ruby
16 lines
458 B
Ruby
require 'spec_helper'
|
|
|
|
describe Zero::Renderer::TemplateFinder, '#exist?' do
|
|
subject { described_class.new(template_path, type_map) }
|
|
let(:template_path) { 'spec/fixtures/templates/' }
|
|
let(:type_map) { {'html' => 'text/html'} }
|
|
|
|
it 'returns true when the template exists' do
|
|
expect(subject.exist?('index')).to be(true)
|
|
end
|
|
|
|
it 'returns false when the template does not exist' do
|
|
expect(subject.exist?('not_found')).to be(false)
|
|
end
|
|
end
|