OSDN Git Service

none
authormasahino <masahino@0978bef0-6439-0410-a06b-a62e4d60c955>
Thu, 4 Mar 2010 15:03:00 +0000 (15:03 +0000)
committermasahino <masahino@0978bef0-6439-0410-a06b-a62e4d60c955>
Thu, 4 Mar 2010 15:03:00 +0000 (15:03 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lbw/ldblogwriter/trunk@93 0978bef0-6439-0410-a06b-a62e4d60c955

test/test-entry.rb
test/test-ldblogwriter.rb
test/test-parser.rb

index 924c920..a082d9a 100644 (file)
@@ -7,7 +7,7 @@ require 'ldblogwriter/entry.rb'
 
 class TestEntry < Test::Unit::TestCase
   def setup
-    @conf = LDBlogWriter::Config.new('test.conf')
+    @conf = LDBlogWriter::Config.new('test/test.conf')
     @parser = LDBlogWriter::Parser.new(@conf, nil)
   end
 
index eebc6eb..caa4cb8 100644 (file)
@@ -14,7 +14,6 @@ require 'test/test-service.rb'
 require 'test/test-service_builder.rb'
 require 'test/test-trackback.rb'
 require 'test/test-wsse.rb'
-require 'test/services/test-livedoor.rb'
 
 
 class TestLDBlogWriter < Test::Unit::TestCase
index ba4b358..45bd886 100644 (file)
@@ -5,6 +5,7 @@ require 'test/unit'
 require 'ldblogwriter/config.rb'
 require 'ldblogwriter/parser.rb'
 require 'ldblogwriter/entry.rb'
+require 'ldblogwriter/service.rb'
 
 module LDBlogWriter
   class Command
@@ -17,7 +18,8 @@ end
 class TestParser < Test::Unit::TestCase
   def setup
     @conf = LDBlogWriter::Config.new('test/test.conf')
-    @parser = LDBlogWriter::Parser.new(@conf, nil)
+    service = LDBlogWriter::Service::DummyService.new(@conf)
+    @parser = LDBlogWriter::Parser.new(@conf, nil, service)
   end
 
     def test_to_html
@@ -27,9 +29,9 @@ class TestParser < Test::Unit::TestCase
     end
 
   def test_parse_img
-    assert(@parser.parse_img('img(test.jpg)'))
+    assert(@parser.parse_img('#img(test/test.jpg)'))
     assert_equal(['<a href="http://image.blog.livedoor.jp/test_user/imgs/8/a/8a4d2846.jpg" target="_blank"><img src="http://image.blog.livedoor.jp/test_user/imgs/8/a/8a4d2846-s.jpg" alt="test" hspace="5" class="pict" align="left" /></a>'],
-                 @parser.parse_img('img(test.jpg, test)'))
+                 @parser.parse_img('#img(test.jpg, test)'))
   end
 
   def test_parse_ul
@@ -87,7 +89,7 @@ class TestParser < Test::Unit::TestCase
 
   def test_parse_trackback
     entry = LDBlogWriter::BlogEntry.new(@conf, "test", "category")
-    @parser.to_html("!trackback(http://app.blog.livedoor.jp/masahino123/tb.cgi/64994357)", entry)
+    @parser.to_html("#trackback(http://app.blog.livedoor.jp/masahino123/tb.cgi/64994357)", entry)
     assert_equal(["http://app.blog.livedoor.jp/masahino123/tb.cgi/64994357"],
                  entry.trackback_url_array)
   end