OSDN Git Service

no comments
[lbw/ldblogwriter2.git] / test / test-ldblogwriter.rb
1 $LOAD_PATH.unshift '../lib'
2
3 require 'test/unit'
4 require 'ldblogwriter.rb'
5
6 class TestLDBlogWriter < Test::Unit::TestCase
7   def setup
8
9   end
10
11   def test_get_blog_info
12     LDBlogWriter::Blog.new
13   end
14
15   def test_check_img_file
16     blog = LDBlogWriter::Blog.new
17     assert_equal("img(../test/test.jpg)\n\nhogehoge", blog.check_image_file("../test/test.txt", "hogehoge"))
18     assert_equal("img(./test.jpg)\n\nhogehoge", blog.check_image_file("test.txt", "hogehoge"))
19     assert_equal("hogehoge", blog.check_image_file("nofile.txt", "hogehoge"))
20
21     assert_equal("img(../test/test2.png)\n\nhogehoge", blog.check_image_file("../test/test2.txt", "hogehoge"))
22     assert_equal("img(./test2.png)\n\nhogehoge", blog.check_image_file("test2.txt", "hogehoge"))
23   end
24 end