Sha256: 14924504ec459a493d2a3eb6e1d16d537c35a96a19ca78187eaf9c6d9e76de0a
Contents?: true
Size: 1004 Bytes
Versions: 13
Compression:
Stored size: 1004 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe TemplateRepository do let(:creator_klass) do Class.new do def initialize(path) end def name :template end def content 'content' end end end context '#initialize' do it 'accepts a path' do TemplateRepository.new('path', creator_klass) end end context '#find' do it 'finds a template by name' do dir = create_directory('repo') file = create_file('repo/template.erb') repo = TemplateRepository.new(dir, creator_klass) template_file = repo.find(File.basename(file, '.*')) expect(template_file.name).to eq(:template) end it 'finds a template by name' do dir = create_directory('repo') file = create_file('repo/template.erb') repo = TemplateRepository.new(dir, creator_klass) template_file = repo.find(File.basename(file, '.*').to_sym) expect(template_file.name).to eq(:template) end end end
Version data entries
13 entries across 13 versions & 1 rubygems