require File.dirname(__FILE__) + '/../test_helper' class FortythreeTest < Test::Unit::TestCase def setup @fortythree = Fortythree.new("", false) @fortythree.send(:parse, fixture) end def test_parser assert_equal 3, @fortythree.things.size end def test_fields assert_equal "43 Things: activity for anoop", @fortythree.title assert_equal "http://www.43things.com/people/view/anoop", @fortythree.link end def test_items assert_equal "Tidy my room and keep it that way", @fortythree.things[0].title assert_equal "http://www.43things.com/things/view/3500", @fortythree.things[0].link end private def fixture %{ 43 Things: activity for anoop http://www.43things.com/people/view/anoop activity for anoop Sat, 23 Apr 2005 17:01:44 GMT Fri, 22 Apr 2005 21:38:34 GMT http://www.43things.com/ http://www.43things.com/images/icons/43-icon-31x31.gif http://www.43things.com/home 43 Things Icon Tidy my room and keep it that way <a href="http://www.43things.com/people/view/anoop">anoop</a> adopted this goal Fri, 22 Apr 2005 21:38:34 GMT http://www.43things.com/things/view/3500 nobody@43things.com (anoop) run a marathon <a href="http://www.43things.com/people/view/anoop">anoop</a> adopted this goal Fri, 22 Apr 2005 20:38:48 GMT http://www.43things.com/things/view/245 nobody@43things.com (anoop) cure cancer <a href="http://www.43things.com/people/view/anoop">anoop</a> adopted this goal Tue, 01 Mar 2005 08:33:24 GMT http://www.43things.com/things/view/36857 nobody@43things.com (anoop) } end end