Sha256: 1c9c9501933914621fe6381c3aee74dac8c15a4bb3041661a12d3cf8b3bd61ba

Contents?: true

Size: 848 Bytes

Versions: 9

Compression:

Stored size: 848 Bytes

Contents

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

class TestSite < Test::Unit::TestCase
  def setup
    @source = File.join(File.dirname(__FILE__), *%w[source])
    @s = Site.new(@source, dest_dir)
  end
  
  def test_site_init
    
  end
  
  def test_read_layouts
    @s.read_layouts
    
    assert_equal ["default", "simple"].sort, @s.layouts.keys.sort
  end
 
  def test_read_posts
    @s.read_posts('')
    posts = Dir[File.join(@source, '_posts/*')]
    assert_equal posts.size - 1, @s.posts.size
  end
  
  def test_site_payload
    clear_dest
    @s.process
    
    posts = Dir[File.join(@source, "**", "_posts/*")]
    categories = %w(bar baz category foo z_category publish_test).sort

    assert_equal posts.size - 1, @s.posts.size
    assert_equal categories, @s.categories.keys.sort
    assert_equal 3, @s.categories['foo'].size
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
danski-jekyll-0.4.1 test/test_site.rb
elq-jekyll-0.4.2 test/test_site.rb
mattmatt-jekyll-0.4.0 test/test_site.rb
mattmatt-jekyll-0.4.1 test/test_site.rb
mattmatt-jekyll-0.4.3 test/test_site.rb
mattmatt-jekyll-0.4.4 test/test_site.rb
mattmatt-jekyll-0.4.5 test/test_site.rb
qrush-jekyll-0.4.0 test/test_site.rb
qrush-jekyll-0.4.1 test/test_site.rb