Sha256: e2d9167dc6d21856cef8db3fa985392ca443e727cb4090868cb3abdeb76753ec
Contents?: true
Size: 1.05 KB
Versions: 37
Compression:
Stored size: 1.05 KB
Contents
require 'test_helper' module Vedeu describe Template do let(:described) { Vedeu::Template } let(:instance) { described.new(object, path) } let(:object) {} let(:path) {} describe '#initialize' do it { instance.must_be_instance_of(described) } it { instance.instance_variable_get('@object').must_equal(object) } it { instance.instance_variable_get('@path').must_equal('') } end describe '.parse' do subject { described.parse(object, path) } before { File.stubs(:read).returns('') } context 'when the path is empty' do it { proc { subject }.must_raise(MissingRequired) } end context 'when the path is does not exist' do let(:path) { '/tmp/vedeu_does_not_exist' } it { proc { subject }.must_raise(MissingRequired) } end context 'when the path exists' do let(:path) { '/tmp/vedeu_does_exist' } before { File.stubs(:exist?).returns(true) } it { subject.must_equal('') } end end end # Template end # Vedeu
Version data entries
37 entries across 37 versions & 1 rubygems