Sha256: 4bdfe45024aed7254eedbca5c696256695364893d3b0487f32dfae166d531029

Contents?: true

Size: 1.08 KB

Versions: 13

Compression:

Stored size: 1.08 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 post.content" do
      latest_post = Dir[source_dir('_posts', '*')].sort.last
      post = Post.new(@site, source_dir, '', File.basename(latest_post))
      post.transform
      assert @index.include?(post.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
  end
end

Version data entries

13 entries across 13 versions & 10 rubygems

Version Path
PerfectlyNormal-jekyll-0.5.1 test/test_generated_site.rb
cduruk-jekyll-0.5.2 test/test_generated_site.rb
codeslinger-jekyll-0.5.1 test/test_generated_site.rb
cypher-jekyll-0.5.2 test/test_generated_site.rb
cypher-jekyll-0.5.3 test/test_generated_site.rb
henrik-jekyll-0.5.2 test/test_generated_site.rb
mojombo-jekyll-0.5.1 test/test_generated_site.rb
qrush-jekyll-0.5.1 test/test_generated_site.rb
tkmr-jekyll-0.5.1 test/test_generated_site.rb
tkmr-jekyll-0.5.2 test/test_generated_site.rb
crnixon-jekyll-0.5.2 test/test_generated_site.rb
crnixon-jekyll-0.5.1 test/test_generated_site.rb
jekyll-0.5.1 test/test_generated_site.rb