require File.join( File.dirname(__FILE__), 'test.rb') class ActorBuilderTest < Test::Unit::TestCase def test_that_actors_are_parsed xml = %| | data = Nokogiri.XML(xml).search('//.') assert_equal ['George Wendt', 'Robert Hy Gorman'], ActorBuilder.from_movie(data).sort end def test_that_cast_reference_is_pulled NetFlix::Request.expects(:new).with(:url => 'http://api.netflix.com/catalog/titles/movies/60024073/cast').returns(stub_everything(:send => '')) xml = %| | data = Nokogiri.XML(xml).search('//title_index_item') ActorBuilder.from_movie(data) end def test_that_cast_list_is_parsable xml = %|http://api.netflix.com/catalog/people/20037237Vanessa Bell Calloway| assert_equal ['Vanessa Bell Calloway'], ActorBuilder.from_xml(xml) end end