Sha256: c6478efe898d23f456528fcf2a273ebb96680bb46124e25498de64e5a039e4f2

Contents?: true

Size: 1.52 KB

Versions: 14

Compression:

Stored size: 1.52 KB

Contents

require 'rubygems'
require 'test/unit'
require 'pp'

require 'youtube_g'

class TestVideo < Test::Unit::TestCase
  def test_should_extract_unique_id_from_video_id
    video = YouTubeG::Model::Video.new(:video_id => "http://gdata.youtube.com/feeds/videos/ZTUVgYoeN_o")
    assert_equal "ZTUVgYoeN_o", video.unique_id
  end

  def test_should_extract_unique_id_with_hypen_from_video_id
    video = YouTubeG::Model::Video.new(:video_id => "http://gdata.youtube.com/feeds/videos/BDqs-OZWw9o")
    assert_equal "BDqs-OZWw9o", video.unique_id
  end

  def test_should_have_related_videos
    video = YouTubeG::Model::Video.new(:video_id => "http://gdata.youtube.com/feeds/videos/BDqs-OZWw9o")
    response = video.related

    assert_equal "http://gdata.youtube.com/feeds/api/videos/BDqs-OZWw9o/related", response.feed_id
    assert_equal 25, response.max_result_count
    assert_equal 25, response.videos.length
    assert_equal 1, response.offset
    assert(response.total_result_count > 0)
    assert_instance_of Time, response.updated_at
  end
  
  def test_should_have_response_videos
    video = YouTubeG::Model::Video.new(:video_id => "http://gdata.youtube.com/feeds/videos/BDqs-OZWw9o")
    response = video.responses

    assert_equal "http://gdata.youtube.com/feeds/api/videos/BDqs-OZWw9o/responses", response.feed_id
    assert_equal 25, response.max_result_count
    assert_equal 25, response.videos.length
    assert_equal 1, response.offset
    assert(response.total_result_count > 0)
    assert_instance_of Time, response.updated_at
  end
  
end

Version data entries

14 entries across 14 versions & 7 rubygems

Version Path
youtube-g-es-0.5.1 test/test_video.rb
beef-youtube-g-0.4.9.9 test/test_video.rb
ceritium-youtube-g-extra-0.0.0.1 test/test_video.rb
ceritium-youtube-g2-0.4.9.1 test/test_video.rb
msp-youtube-g-0.4.8.1 integration-test/test_video.rb
msp-youtube-g-0.4.8.3 integration-test/test_video.rb
msp-youtube-g-0.4.8.4 integration-test/test_video.rb
msp-youtube-g-0.4.8.6 integration-test/test_video.rb
msp-youtube-g-0.4.8.7 integration-test/test_video.rb
tmm1-youtube-g-0.4.9.1 test/test_video.rb
tmm1-youtube-g-0.4.9 test/test_video.rb
tmm1-youtube-g-0.5.0 test/test_video.rb
youtube-g-0.5.0 test/test_video.rb
youtube-g-0.4.9.9 test/test_video.rb