Skip to content

Commit

Permalink
add test for parse playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilperez authored and grosser committed Dec 8, 2011
1 parent 7460500 commit 4edd3ec
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion spec/youtube_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
end

describe 'parse' do
it "can parse xml" do
it "can parse xml from a search" do
# convert to array so we get a nice diff in case of errors
YoutubeSearch.parse(File.read('spec/fixtures/search_boat.xml')).first.sort.should == [
["author",nil],
Expand All @@ -24,6 +24,26 @@
["video_id", "0b2U5r7Jwkc"],
]
end

it "can parse xml from a playlist" do
YoutubeSearch.parse(File.read('spec/fixtures/playlist_5F23DAF4BFE3D14C.xml'), true).first.sort.should == [
["accessControl",nil],
["author",nil],
["category", nil],
["comments",nil],
["group", nil],
["id","tag:youtube.com,2008:playlist:5F23DAF4BFE3D14C:kRk0fUfl9UJvHjGFHgPSakUFmztBgGKG"],
["link",nil],
["position","1"],
["rating", nil],
["recorded", "2010-01-08"],
["statistics",nil],
["title","Osteopatia y terapias manuales"],
["updated","2011-12-07T01:46:21.650Z"],
["video_id", "5wU-yHnq7Hs"],
["where", nil]
]
end
end

describe 'search' do
Expand Down

0 comments on commit 4edd3ec

Please sign in to comment.