Typhoeus::Response hack moved to hacks.rb, ignoring hacks.rb in coverage

This commit is contained in:
erwanlr
2013-03-22 18:37:28 +01:00
parent d937b20d79
commit e058b204f4
3 changed files with 17 additions and 16 deletions

View File

@@ -3,4 +3,5 @@ SimpleCov.start do
add_filter "_helper.rb"
add_filter "environment.rb"
add_filter "_plugin.rb"
add_filter "hacks.rb"
end

View File

@@ -26,6 +26,22 @@ if RUBY_VERSION < '1.9'
end
end
# This is used in WpItem::Existable
module Typhoeus
class Response
# Compare the body hash to error_404_hash and homepage_hash
# returns true if they are different, false otherwise
#
# @return [ Boolean ]
def has_valid_hash?(error_404_hash, homepage_hash)
body_hash = Digest::MD5.hexdigest(self.body)
body_hash != error_404_hash && body_hash != homepage_hash
end
end
end
# Override for puts to enable logging
def puts(o = '')
# remove color for logging

View File

@@ -1,21 +1,5 @@
# encoding: UTF-8
# HACK
module Typhoeus
class Response
# Compare the body hash to error_404_hash and homepage_hash
# returns true if they are different, false otherwise
#
# @return [ Boolean ]
def has_valid_hash?(error_404_hash, homepage_hash)
body_hash = Digest::MD5.hexdigest(self.body)
body_hash != error_404_hash && body_hash != homepage_hash
end
end
end
class WpItem
module Existable