Typhoeus::Response hack moved to hacks.rb, ignoring hacks.rb in coverage
This commit is contained in:
@@ -3,4 +3,5 @@ SimpleCov.start do
|
|||||||
add_filter "_helper.rb"
|
add_filter "_helper.rb"
|
||||||
add_filter "environment.rb"
|
add_filter "environment.rb"
|
||||||
add_filter "_plugin.rb"
|
add_filter "_plugin.rb"
|
||||||
|
add_filter "hacks.rb"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,6 +26,22 @@ if RUBY_VERSION < '1.9'
|
|||||||
end
|
end
|
||||||
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
|
# Override for puts to enable logging
|
||||||
def puts(o = '')
|
def puts(o = '')
|
||||||
# remove color for logging
|
# remove color for logging
|
||||||
|
|||||||
@@ -1,21 +1,5 @@
|
|||||||
# encoding: UTF-8
|
# 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
|
class WpItem
|
||||||
module Existable
|
module Existable
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user