test/lib/vedeu/templating/template_test.rb in vedeu-0.5.0 vs test/lib/vedeu/templating/template_test.rb in vedeu-0.5.1

- old
+ new

@@ -27,15 +27,22 @@ end context 'when the path is does not exist' do let(:path) { '/tmp/vedeu_does_not_exist' } + before { File.stubs(:exist?).returns(false) } + it { proc { subject }.must_raise(MissingRequired) } end context 'when the path exists' do - let(:path) { 'test/support/templates/plain.erb' } + let(:path) { '/tmp/vedeu_exists' } let(:expected) { "This is a test.\n" } + + before { + File.stubs(:exist?).returns(true) + File.stubs(:read).returns(expected) + } it { subject.must_equal(expected) } end end