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

Version Path
vedeu-0.4.34 test/lib/vedeu/support/template_test.rb
vedeu-0.4.33 test/lib/vedeu/support/template_test.rb
vedeu-0.4.32 test/lib/vedeu/support/template_test.rb
vedeu-0.4.31 test/lib/vedeu/support/template_test.rb
vedeu-0.4.30 test/lib/vedeu/support/template_test.rb
vedeu-0.4.29 test/lib/vedeu/support/template_test.rb
vedeu-0.4.28 test/lib/vedeu/support/template_test.rb
vedeu-0.4.27 test/lib/vedeu/support/template_test.rb
vedeu-0.4.26 test/lib/vedeu/support/template_test.rb
vedeu-0.4.25 test/lib/vedeu/support/template_test.rb
vedeu-0.4.24 test/lib/vedeu/support/template_test.rb
vedeu-0.4.23 test/lib/vedeu/support/template_test.rb
vedeu-0.4.22 test/lib/vedeu/support/template_test.rb
vedeu-0.4.21 test/lib/vedeu/support/template_test.rb
vedeu-0.4.20 test/lib/vedeu/support/template_test.rb
vedeu-0.4.19 test/lib/vedeu/support/template_test.rb
vedeu-0.4.18 test/lib/vedeu/support/template_test.rb