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.54 test/lib/vedeu/support/template_test.rb
vedeu-0.4.53 test/lib/vedeu/support/template_test.rb
vedeu-0.4.52 test/lib/vedeu/support/template_test.rb
vedeu-0.4.51 test/lib/vedeu/support/template_test.rb
vedeu-0.4.50 test/lib/vedeu/support/template_test.rb
vedeu-0.4.49 test/lib/vedeu/support/template_test.rb
vedeu-0.4.48 test/lib/vedeu/support/template_test.rb
vedeu-0.4.47 test/lib/vedeu/support/template_test.rb
vedeu-0.4.46 test/lib/vedeu/support/template_test.rb
vedeu-0.4.45 test/lib/vedeu/support/template_test.rb
vedeu-0.4.44 test/lib/vedeu/support/template_test.rb
vedeu-0.4.43 test/lib/vedeu/support/template_test.rb
vedeu-0.4.42 test/lib/vedeu/support/template_test.rb
vedeu-0.4.41 test/lib/vedeu/support/template_test.rb
vedeu-0.4.40 test/lib/vedeu/support/template_test.rb
vedeu-0.4.39 test/lib/vedeu/support/template_test.rb
vedeu-0.4.38 test/lib/vedeu/support/template_test.rb
vedeu-0.4.37 test/lib/vedeu/support/template_test.rb
vedeu-0.4.36 test/lib/vedeu/support/template_test.rb
vedeu-0.4.35 test/lib/vedeu/support/template_test.rb