test/test_favstar.rb in stars-0.4.0 vs test/test_favstar.rb in stars-0.5.0

- old
+ new

@@ -1,16 +1,28 @@ require 'helper' class TestFavstar < Test::Unit::TestCase def setup + global_setup @favstar = Stars::Favstar.new end - - def test_parties_hard - mock(Stars::Favstar).get('/users/holman/rss', :format => :xml) { - {'rss' => {'channel' => {'item' => 'etc'} } } - } - @favstar.recent('holman') + + def test_parse_title + title = "6 stars: Zach Holman is attractive and handsome." + parsed_title = @favstar.parse_title(title) + assert_equal "Zach Holman is attractive and handsome.", parsed_title end -end \ No newline at end of file + def test_parse_title_with_colons + title = "6 stars: Zach Holman is: attractive and handsome." + parsed_title = @favstar.parse_title(title) + assert_equal "Zach Holman is: attractive and handsome.", parsed_title + end + + def test_parse_stars + title = "6 stars: Zach Holman is attractive and handsome." + parsed_stars = @favstar.parse_stars(title) + assert_equal 6, parsed_stars + end + +end