From 2c558846ec6aeb784f2774d675b876c198ee150a Mon Sep 17 00:00:00 2001 From: Stormwind Date: Sun, 6 Jan 2013 17:39:57 +0100 Subject: Kill all mutants in Zero::Renderer --- spec/unit/renderer/read_template_path_spec.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'spec/unit/renderer/read_template_path_spec.rb') diff --git a/spec/unit/renderer/read_template_path_spec.rb b/spec/unit/renderer/read_template_path_spec.rb index e025bb1..8655777 100644 --- a/spec/unit/renderer/read_template_path_spec.rb +++ b/spec/unit/renderer/read_template_path_spec.rb @@ -6,7 +6,13 @@ describe Zero::Renderer, 'read_template_path!' do let(:file_list) { ['foo/welcome/index.html.erb'] } before :each do - subject.stub(:search_files).and_return(file_list) + Dir.stub(:[]) do |arg| + if arg == 'foo/**/*.*' + file_list + else + [] + end + end end shared_examples_for 'a template loader' do @@ -50,4 +56,11 @@ describe Zero::Renderer, 'read_template_path!' do it_behaves_like 'a template loader' end + + it 'creates an empty templates list without templates in path' do + subject = Zero::Renderer.new("bar", {}) + subject.read_template_path! + + subject.templates.should eq({}) + end end -- cgit v1.2.3-70-g09d2