test/youtube_test.rb in muri-0.0.8 vs test/youtube_test.rb in muri-0.0.9
- old
+ new
@@ -1,123 +1,123 @@
require 'lib/muri.rb'
shared_examples_for "Youtube parse" do
it "should be Youtube service" do
- @a.service == 'Youtube'
+ @a.service.should == 'Youtube'
end
it "should be valid" do
- @a.valid? == true
+ @a.valid?.should == true
end
end
shared_examples_for "Youtube parse single" do
it_should_behave_like "Youtube parse"
it "should have media api type = YOUTUBE_VIDEO" do
- @a.media_api_type == Muri::YOUTUBE_VIDEO
+ @a.media_api_type.should == Muri::YOUTUBE_VIDEO
end
end
shared_examples_for "Youtube parse playlist" do
it_should_behave_like "Youtube parse"
it "should have media api type = YOUTUBE_PLAYLIST" do
- @a.media_api_type == Muri::YOUTUBE_PLAYLIST
+ @a.media_api_type.should == Muri::YOUTUBE_PLAYLIST
end
end
describe "Youtube parse first" do
before(:all) do
@a = Muri.parse 'http://www.youtube.com/v/4CYDFoEz8rg&hl=en_US&fs=1&'
end
it_should_behave_like "Youtube parse single"
it "should have media id" do
- @a.media_id == '4CYDFoEz8rg'
+ @a.media_id.should == '4CYDFoEz8rg'
end
it "should have media api id" do
- @a.media_api_id == '4CYDFoEz8rg'
+ @a.media_api_id.should == '4CYDFoEz8rg'
end
it "should have media url" do
- @a.website == 'http://www.youtube.com/watch?v=4CYDFoEz8rg'
+ @a.website.should == 'http://www.youtube.com/watch?v=4CYDFoEz8rg'
end
it "should have website" do
- @a.media_url == 'http://www.youtube.com/v/4CYDFoEz8rg'
+ @a.media_url.should == 'http://www.youtube.com/v/4CYDFoEz8rg'
end
it "should have thumbnail" do
- @a.media_thumbnail == 'http://i.ytimg.com/vi/4CYDFoEz8rg/default.jpg'
+ @a.media_thumbnail.should == 'http://i.ytimg.com/vi/4CYDFoEz8rg/default.jpg'
end
end
describe "Youtube parse second" do
before(:all) do
@a = Muri.parse 'http://www.youtube.com/watch?v=4CYDFoEz8rg'
end
it_should_behave_like "Youtube parse single"
it "should have media id" do
- @a.media_id == '4CYDFoEz8rg'
+ @a.media_id.should == '4CYDFoEz8rg'
end
it "should have media api id" do
- @a.media_api_id == '4CYDFoEz8rg'
+ @a.media_api_id.should == '4CYDFoEz8rg'
end
it "should have media url" do
- @a.website == 'http://www.youtube.com/watch?v=4CYDFoEz8rg'
+ @a.website.should == 'http://www.youtube.com/watch?v=4CYDFoEz8rg'
end
it "should have website" do
- @a.media_url == 'http://www.youtube.com/v/4CYDFoEz8rg'
+ @a.media_url.should == 'http://www.youtube.com/v/4CYDFoEz8rg'
end
it "should have thumbnail" do
- @a.media_thumbnail == 'http://i.ytimg.com/vi/4CYDFoEz8rg/default.jpg'
+ @a.media_thumbnail.should == 'http://i.ytimg.com/vi/4CYDFoEz8rg/default.jpg'
end
end
describe "Youtube parse playlist first" do
before(:all) do
@a = Muri.parse 'http://www.youtube.com/p/57633EC69B4A10A2&hl=en_US&fs=1'
end
it_should_behave_like "Youtube parse playlist"
it "should have media id" do
- @a.media_id == '57633EC69B4A10A2'
+ @a.media_id.should == '57633EC69B4A10A2'
end
it "should have media api id" do
- @a.media_api_id == '57633EC69B4A10A2'
+ @a.media_api_id.should == '57633EC69B4A10A2'
end
it "should have media url" do
- @a.website == 'http://www.youtube.com/view_play_list?p=57633EC69B4A10A2'
+ @a.website.should == 'http://www.youtube.com/view_play_list?p=57633EC69B4A10A2'
end
it "should have website" do
- @a.media_url == 'http://www.youtube.com/p/57633EC69B4A10A2'
+ @a.media_url.should == 'http://www.youtube.com/p/57633EC69B4A10A2'
end
end
describe "Youtube parse playlist second" do
before(:all) do
@a = Muri.parse 'http://www.youtube.com/view_play_list?p=57633EC69B4A10A2'
end
it_should_behave_like "Youtube parse playlist"
it "should have media id" do
- @a.media_id == '57633EC69B4A10A2'
+ @a.media_id.should == '57633EC69B4A10A2'
end
it "should have media api id" do
- @a.media_api_id == '57633EC69B4A10A2'
+ @a.media_api_id.should == '57633EC69B4A10A2'
end
it "should have media url" do
- @a.website == 'http://www.youtube.com/view_play_list?p=57633EC69B4A10A2'
+ @a.website.should == 'http://www.youtube.com/view_play_list?p=57633EC69B4A10A2'
end
it "should have website" do
- @a.media_url == 'http://www.youtube.com/p/57633EC69B4A10A2'
+ @a.media_url.should == 'http://www.youtube.com/p/57633EC69B4A10A2'
end
end