require File.dirname(__FILE__) + '/../test_helper' class DeliciousTest < Test::Unit::TestCase def setup @delicious = Delicious.new("", false) @delicious.send(:parse, fixture) end def test_parser assert_equal 3, @delicious.items.size end def test_fields assert_equal "del.icio.us/shanev", @delicious.title assert_equal "http://del.icio.us/shanev", @delicious.link end def test_items assert_equal "Guide to Using XMLHttpRequest (with Baby Steps)", @delicious.items[0].title assert_equal "http://www.webpasties.com/xmlHttpRequest/", @delicious.items[0].link end private def fixture %{ del.icio.us/shanev http://del.icio.us/shanev Guide to Using XMLHttpRequest (with Baby Steps) http://www.webpasties.com/xmlHttpRequest/ shanev 2005-02-24T07:11Z XMLHTTPRequest W3 Schools Javascript Tutorial http://www.w3schools.com/js/default.asp shanev 2005-02-24T04:03Z javascript XMLHTTPRequest Library http://www.feedfab.com/xmljs/ shanev 2005-02-22T21:36Z XMLHTTPRequest } end end