Sha256: 1b974db34a3b25185f051e54756c09f599bc2ceef071cddf639bd8b5f3df3291

Contents?: true

Size: 1.14 KB

Versions: 29

Compression:

Stored size: 1.14 KB

Contents

require File.dirname(__FILE__) + '/helper'

class TestGeneratedSite < Test::Unit::TestCase
  context "generated sites" do
    setup do
      clear_dest
      stub(Jekyll).configuration do
        Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
      end

      @site = Site.new(Jekyll.configuration)
      @site.process
      @index = File.read(dest_dir('index.html'))
    end

    should "insert site.posts into the index" do
      assert @index.include?("#{@site.posts.size} Posts")
    end

    should "render latest post's content" do
      assert @index.include?(@site.posts.last.content)
    end

    should "hide unpublished posts" do
      published = Dir[dest_dir('publish_test/2008/02/02/*.html')].map {|f| File.basename(f)}

      assert_equal 1, published.size
      assert_equal "published.html", published.first
    end

    should "not copy _posts directory" do
      assert !File.exist?(dest_dir('_posts'))
    end

    should "process other static files and generate correct permalinks" do
      assert File.exists?(dest_dir('/about/index.html'))
      assert File.exists?(dest_dir('/contacts.html'))
    end
  end
end

Version data entries

29 entries across 29 versions & 14 rubygems

Version Path
Chrononaut-hyde-0.1.0 test/test_generated_site.rb
Chrononaut-hyde-0.1.1 test/test_generated_site.rb
PerfectlyNormal-jekyll-0.5.3 test/test_generated_site.rb
codeslinger-jekyll-0.5.2 test/test_generated_site.rb
codeslinger-jekyll-0.5.3 test/test_generated_site.rb
codeslinger-jekyll-0.5.4 test/test_generated_site.rb
mojombo-jekyll-0.5.2 test/test_generated_site.rb
mojombo-jekyll-0.5.3 test/test_generated_site.rb
pol-hyde-0.1.2 test/test_generated_site.rb
pol-hyde-0.1.3 test/test_generated_site.rb
sixones-jekyll-0.5.2.2 test/test_generated_site.rb
sixones-jekyll-0.5.2 test/test_generated_site.rb
tekin-jekyll-0.5.2 test/test_generated_site.rb
tomafro-jekyll-0.5.2.1 test/test_generated_site.rb
tomafro-jekyll-0.5.3.1 test/test_generated_site.rb
tomafro-jekyll-0.5.3.2 test/test_generated_site.rb
tomafro-jekyll-0.5.3.3 test/test_generated_site.rb
tomafro-jekyll-0.5.3.5 test/test_generated_site.rb
tomafro-jekyll-0.5.3.6 test/test_generated_site.rb
mojombo-jekyll-0.5.4 test/test_generated_site.rb