Commit a30d28b3 authored by Fabio Pelosin's avatar Fabio Pelosin

[Integration] Don't copare diff files if they are equal

parent c7b67015
...@@ -191,7 +191,9 @@ def yaml_should_match(expected, produced) ...@@ -191,7 +191,9 @@ def yaml_should_match(expected, produced)
# Remove CocoaPods version # Remove CocoaPods version
expected_yaml.delete('COCOAPODS') expected_yaml.delete('COCOAPODS')
produced_yaml.delete('COCOAPODS') produced_yaml.delete('COCOAPODS')
desc = [] desc = []
unless expected_yaml == produced_yaml
desc << "YAML comparison error `#{expected}`" desc << "YAML comparison error `#{expected}`"
desc << ("--- YAML DIFF " << "-" * 65) desc << ("--- YAML DIFF " << "-" * 65)
...@@ -212,6 +214,7 @@ def yaml_should_match(expected, produced) ...@@ -212,6 +214,7 @@ def yaml_should_match(expected, produced)
diff.gsub!("$expected", "expected".red) diff.gsub!("$expected", "expected".red)
desc << diff desc << diff
desc << ("--- END " << "-" * 70) desc << ("--- END " << "-" * 70)
end
expected_yaml.should.satisfy(desc * "\n\n") do expected_yaml.should.satisfy(desc * "\n\n") do
if RUBY_VERSION < "1.9" if RUBY_VERSION < "1.9"
...@@ -255,6 +258,7 @@ end ...@@ -255,6 +258,7 @@ end
def file_should_match(expected, produced) def file_should_match(expected, produced)
is_equal = FileUtils.compare_file(expected, produced) is_equal = FileUtils.compare_file(expected, produced)
description = [] description = []
unless is_equal
description << "File comparison error `#{expected}`" description << "File comparison error `#{expected}`"
description << "" description << ""
description << ("--- DIFF " << "-" * 70) description << ("--- DIFF " << "-" * 70)
...@@ -267,6 +271,7 @@ def file_should_match(expected, produced) ...@@ -267,6 +271,7 @@ def file_should_match(expected, produced)
end end
description << ("--- END " << "-" * 70) description << ("--- END " << "-" * 70)
description << "" description << ""
end
is_equal.should.satisfy(description * "\n") do is_equal.should.satisfy(description * "\n") do
is_equal == true is_equal == true
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment