tests/staticpress/content/base_test.rb in staticpress-0.6.0 vs tests/staticpress/content/base_test.rb in staticpress-0.6.1
- old
+ new
@@ -18,10 +18,11 @@
let(:static_bin) { Staticpress::Content::Page.new :slug => 'ruby.png' }
let(:static_txt) { Staticpress::Content::Page.new :slug => 'plain.txt' }
let(:page_fake) { Staticpress::Content::Page.new :slug => 'i/dont/exist' }
let(:post) { Staticpress::Content::Post.new(:year => '2011', :month => '07', :day => '20', :title => 'hello') }
+ let(:unpublished) { Staticpress::Content::Post.new(:year => '2012', :month => '09', :day => '19', :title => 'unpublished') }
let(:tag) { Staticpress::Content::Tag.new :name => 'charlotte' }
let(:asset_style) { Staticpress::Content::Theme.new :theme => 'test_theme', :asset_type => 'styles', :slug => 'all' }
let(:asset_script) { Staticpress::Content::Theme.new :theme => 'test_theme', :asset_type => 'scripts', :slug => 'application.js' }
@@ -73,10 +74,11 @@
assert static_bin.exist?, "#{static_bin} does not exist"
assert static_txt.exist?, "#{static_txt} does not exist"
assert page_root.exist?, "#{page_root} does not exist"
assert post.exist?, "#{post} does not exist"
+ assert unpublished.exist?, "#{unpublished} does not exist"
assert tag.exist?, "#{tag} does not exist"
assert asset_style.exist?, "#{asset_style} does not exist"
assert asset_script.exist?, "#{asset_script} does not exist"
@@ -112,19 +114,20 @@
refute style_2.markup_template?, "#{chained} is markup"
end
def test_output_path
- assert_equal (Staticpress.blog_path + 'public' + 'chained' + 'index.html'), chained.output_path
- assert_equal (Staticpress.blog_path + 'public' + 'chain.html'), chain.output_path
- assert_equal (Staticpress.blog_path + 'public' + 'about' + 'index.html'), page.output_path
- assert_equal (Staticpress.blog_path + 'public' + 'index.html'), page_root.output_path
- assert_equal (Staticpress.blog_path + 'public' + 'style2.css'), style_2.output_path
- assert_equal (Staticpress.blog_path + 'public' + 'ruby.png'), static_bin.output_path
- assert_equal (Staticpress.blog_path + 'public' + 'plain.txt'), static_txt.output_path
- assert_equal (Staticpress.blog_path + 'public' + '2011' + '07' + '20' + 'hello' + 'index.html'), post.output_path
- assert_equal (Staticpress.blog_path + 'public' + 'assets' + 'test_theme' + 'styles' + 'all'), asset_style.output_path
- assert_equal (Staticpress.blog_path + 'public' + 'assets' + 'test_theme' + 'scripts' + 'application.js'), asset_script.output_path
+ output_directory = Staticpress.blog_path + 'public'
+ assert_equal (output_directory + 'chained' + 'index.html'), chained.output_path
+ assert_equal (output_directory + 'chain.html'), chain.output_path
+ assert_equal (output_directory + 'about' + 'index.html'), page.output_path
+ assert_equal (output_directory + 'index.html'), page_root.output_path
+ assert_equal (output_directory + 'style2.css'), style_2.output_path
+ assert_equal (output_directory + 'ruby.png'), static_bin.output_path
+ assert_equal (output_directory + 'plain.txt'), static_txt.output_path
+ assert_equal (output_directory + '2011' + '07' + '20' + 'hello' + 'index.html'), post.output_path
+ assert_equal (output_directory + 'assets' + 'test_theme' + 'styles' + 'all'), asset_style.output_path
+ assert_equal (output_directory + 'assets' + 'test_theme' + 'scripts' + 'application.js'), asset_script.output_path
end
def test_params
expected = { :name => 'charlotte', :number => 1 }
assert_equal expected, tag.params