Sha256: 5dd4bd5a854dcabbb2af43d805f5ffeb771b03daeb69aed568be078264b3054e

Contents?: true

Size: 681 Bytes

Versions: 2

Compression:

Stored size: 681 Bytes

Contents

require 'spec_helper'
module WLang
  describe Template, 'path' do

    subject{ template.path }

    context 'when a string and no option' do
      let(:template){ Template.new("Hello ${who}!") }
      it{ should be_nil }
    end

    context 'when a Path and no option' do
      let(:template){ Template.new(Path.file) }
      it{ should eq(__FILE__) }
    end

    context 'when a string and an option' do
      let(:template){ Template.new("Hello ${who}!", :path => __FILE__) }
      it{ should eq(__FILE__) }
    end

    context 'when a path an an option' do
      let(:template){ Template.new(Path.file, :path => __FILE__) }
      it{ should eq(__FILE__) }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wlang-3.0.1 spec/unit/template/test_path.rb
wlang-3.0.0 spec/unit/template/test_path.rb