Skip to content

Commit

Permalink
Merge pull request #5 from Fullscreen/error_messages
Browse files Browse the repository at this point in the history
Remove testing for Error messages
  • Loading branch information
claudiofullscreen committed Feb 11, 2016
2 parents 9355493 + 5b7a9ff commit f7cc1c3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions lib/yt/audit.rb
Expand Up @@ -6,7 +6,6 @@ module Audit
# Audit any info card of a video
# @param [String] video_id the video to audit.
# @return [Boolean] if the video has any info card.
# @raise [NoMethodError] if video_id is not a valid video.
def self.has_info_cards?(video_id)
Yt::Annotations.for(video_id).any? do |annotation|
annotation.is_a? Yt::Annotations::Card
Expand All @@ -17,7 +16,6 @@ def self.has_info_cards?(video_id)
# @param [String] video_id the video to audit.
# @param [String] brand name of the video to audit.
# @return [Boolean] if the video title includes brand name.
# @raise [Yt::Errors::NoItems] if video_id is not a valid video.
def self.has_brand_anchoring?(video_id, brand)
video_title = Yt::Video.new(id: video_id).title
!!video_title[/#{brand}/i]
Expand All @@ -26,7 +24,6 @@ def self.has_brand_anchoring?(video_id, brand)
# Audit any subscribe annotation of a video
# @param [String] video_id the video to audit.
# @return [Boolean] if the video has any link to subscribe in the annotations.
# @raise [NoMethodError] if video_id is not a valid video.
def self.has_subscribe_annotations?(video_id)
Yt::Annotations.for(video_id).any? do |annotation|
annotation.link && annotation.link[:type] == :subscribe
Expand Down
6 changes: 0 additions & 6 deletions test/yt/audit_test.rb
Expand Up @@ -27,12 +27,6 @@ def test_does_not_have_info_cards
assert_equal false, Yt::Audit.has_info_cards?(@bad_video_id)
end

def test_invalid_video_id
assert_raises(NoMethodError) { Yt::Audit.has_info_cards?('') }
assert_raises(Yt::Errors::NoItems) { Yt::Audit.has_brand_anchoring?('', '') }
assert_raises(NoMethodError) { Yt::Audit.has_subscribe_annotations?('') }
end

def test_has_subscribe_annotations
assert_equal true, Yt::Audit.has_subscribe_annotations?(@good_video_id)
end
Expand Down

0 comments on commit f7cc1c3

Please sign in to comment.