Sha256: e37844913d2c5f3fa2ca6a99c443cb892ef7d6220067dd9bb24127f64edeeb39

Contents?: true

Size: 903 Bytes

Versions: 2

Compression:

Stored size: 903 Bytes

Contents

require File.dirname(__FILE__) + '/../helpers'
require 'bloggit'

class PageTest < Test::Unit::TestCase
  
  should "raise an error if trying to load a `Page` from a non-existant file" do
    assert_raise(RuntimeError) { Bloggit::Page.from_file 'crapfile.page' }
  end
  
  should "parse `Page` from file" do
    assert_nothing_raised(RuntimeError) do
      page = Bloggit::Page.from_file File.join(File.dirname(__FILE__), '../fixtures/test.blog/pages/about.page')
      assert_not_nil page
      assert_equal 'about', page.slug
    end
  end
  
  should "parse status and slug" do
    assert_nothing_raised(RuntimeError) do
      page = Bloggit::Page.from_file File.join(File.dirname(__FILE__), '../fixtures/test.blog/pages/about.page')
      assert_not_nil page
      assert_equal 'About', page.title
      assert_equal 'about', page.slug
      assert_equal 'publish', page.status
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bloggit-1.0.3 test/unit/page_test.rb
bloggit-1.0.7 test/unit/page_test.rb