# Unit tests for the Howcast class. # This class is easy because get_video_url is # just a string interpolation (we don't have to # test that). require 'test/unit' require 'src/websites/howcast' class HowcastTest < Test::Unit::TestCase def test_owns_howcast_urls assert(Howcast.owns_url?('http://www.howcast.com/videos/6807-2twr')) assert(Howcast.owns_url?('www.howcast.com/videos/6807-2dgfdg')) assert(Howcast.owns_url?('http://howcast.com/videos/6807-cse')) assert(Howcast.owns_url?('howcast.com/videos/6807-asdgasd')) end def test_doesnt_own_redtube_urls assert(!Howcast.owns_url?('http://www.redtube.com/6807')) assert(!Howcast.owns_url?('www.redtube.com/6807')) assert(!Howcast.owns_url?('http://redtube.com/6807')) assert(!Howcast.owns_url?('redtube.com/6807')) end def test_doesnt_own_misc_urls assert(!Howcast.owns_url?('http://www.howcast.com/abc')) end end