Sha256: e5f385ef4a06e131ea3d0d8cf8962552060213da3926e3d43aaaeb4058ded1e0

Contents?: true

Size: 697 Bytes

Versions: 26

Compression:

Stored size: 697 Bytes

Contents

require 'helper'

class TestURL < Test::Unit::TestCase
  context "The URL class" do

    should "throw an exception if neither permalink or template is specified" do
      assert_raises ArgumentError do
        URL.new(:placeholders => {})
      end
    end

    should "replace placeholders in templates" do
      assert_equal "/foo/bar", URL.new(
        :template => "/:x/:y",
        :placeholders => {:x => "foo", :y => "bar"}
      ).to_s
    end

    should "return permalink if given" do
      assert_equal "/le/perma/link", URL.new(
        :template => "/:x/:y",
        :placeholders => {:x => "foo", :y => "bar"},
        :permalink => "/le/perma/link"
      ).to_s
    end

  end
end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
jekyll-2.2.0 test/test_url.rb
jekyll-2.1.1 test/test_url.rb
jekyll-2.1.0 test/test_url.rb
jekyll-2.0.3 test/test_url.rb
jekyll-2.0.2 test/test_url.rb
jekyll-2.0.1 test/test_url.rb
jekyll-2.0.0 test/test_url.rb
jekyll-2.0.0.rc1 test/test_url.rb
jekyll-2.0.0.alpha.3 test/test_url.rb
jekyll-1.5.1 test/test_url.rb
jekyll-2.0.0.alpha.2 test/test_url.rb
jekyll-1.5.0 test/test_url.rb
tigefa-1.1.3 test/test_url.rb
tigefa-1.1.2 test/test_url.rb
jekyll-2.0.0.alpha.1 test/test_url.rb
tigefa-1.1.1 test/test_url.rb
jekyll-1.4.3 test/test_url.rb
jekyll-1.4.2 test/test_url.rb
jekyll-1.4.1 test/test_url.rb
jekyll-1.4.0 test/test_url.rb