Sha256: dc4808864c83884c521e7ac93366b4b4bc8cd1bb6dabb8de0a0ebbde97a90047

Contents?: true

Size: 775 Bytes

Versions: 3

Compression:

Stored size: 775 Bytes

Contents

require 'spec_helper'

describe Hotcell::Resolver do
  specify { expect { subject.template 'any/path' }.to raise_error NotImplementedError }

  describe '#template' do
    let(:dummy) do
      Class.new(described_class) do
        def resolve path, context = nil
          path
        end
      end
    end
    subject { dummy.new.template('template/source') }

    it { should be_a Hotcell::Template }
    its('source.source') { should == 'template/source' }
  end
end

describe Hotcell::FileSystemResolver do
  subject(:resolver) { described_class.new(data_path('templates')) }

  describe '#resolve' do
    specify { subject.resolve('simple').should == 'Hello, {{ name }}' }
    specify { expect { subject.resolve('unexisting') }.to raise_error Errno::ENOENT }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hotcell-0.3.0 spec/lib/hotcell/resolver_spec.rb
hotcell-0.2.0 spec/lib/hotcell/resolver_spec.rb
hotcell-0.1.0 spec/lib/hotcell/resolver_spec.rb