Sha256: 2047b87ce6d5a7962f11e15f6d5a59853006023f3004ff63affc2ac84c346369
Contents?: true
Size: 1.6 KB
Versions: 3
Compression:
Stored size: 1.6 KB
Contents
require_relative '../../test_case' class ContentPostTest < TestCase include Staticpress::Helpers let(:post_dir) { Staticpress.blog_path + config.posts_source_path } let(:post) { Staticpress::Content::Post.new(:year => '2011', :month => '07', :day => '20', :title => 'hello') } let(:another_post) { Staticpress::Content::Post.new(:year => '2011', :month => '08', :day => '20', :title => 'forever') } let(:long_title_post) { Staticpress::Content::Post.new(:year => '2011', :month => '08', :day => '06', :title => 'blogging-with-staticpress') } def test__spaceship assert_operator post, :<=>, another_post assert_operator another_post, :<=>, post assert_equal [ post, another_post ], [ post, another_post ].sort assert_equal [ post, another_post ], [ another_post, post ].sort end def test_created_at assert_equal Time.utc(2011, 7, 20, 13, 9, 52), post.created_at assert_equal Time.utc(2011, 8, 20), another_post.created_at end def test_created_on assert_equal Time.utc(2011, 7, 20), post.created_on assert_equal Time.utc(2011, 8, 20), another_post.created_on end def test_find_by_path assert_equal post, Staticpress::Content::Post.find_by_path(post_dir + '2011-07-20-hello.markdown') assert_nil Staticpress::Content::Post.find_by_path(post_dir + '2011-07-20-goodbye.markdown') end def test_template_path assert_equal (Staticpress.blog_path + config.posts_source_path + '2011-07-20-hello.markdown'), post.template_path end def test_title assert_equal 'Hello, World', post.title assert_equal 'Blogging With Staticpress', long_title_post.title end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
staticpress-0.6.2 | tests/staticpress/content/post_test.rb |
staticpress-0.6.1 | tests/staticpress/content/post_test.rb |
staticpress-0.6.0 | tests/staticpress/content/post_test.rb |