Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/rocket_pants/rspec_matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ def self.normalised_error(e)
end
end

KEYS_TO_DELETE = %w(url root instance_options).freeze
def self.normalise_urls(object)
if object.is_a?(Array)
object.each { |o| o['url'] = nil }
object.each do |o|
KEYS_TO_DELETE.each { |key| o[key] = nil }
end
elsif object.is_a?(Hash) || (defined?(APISmith::Smash) && object.is_a?(APISmith::Smash))
object['url'] = nil
KEYS_TO_DELETE.each { |key| object[key] = nil }
end
object
end
Expand Down