Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
a30d28b3
Commit
a30d28b3
authored
Sep 06, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Integration] Don't copare diff files if they are equal
parent
c7b67015
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
28 deletions
+33
-28
integration.rb
spec/integration.rb
+33
-28
No files found.
spec/integration.rb
View file @
a30d28b3
...
...
@@ -191,27 +191,30 @@ def yaml_should_match(expected, produced)
# Remove CocoaPods version
expected_yaml
.
delete
(
'COCOAPODS'
)
produced_yaml
.
delete
(
'COCOAPODS'
)
desc
=
[]
desc
<<
"YAML comparison error `
#{
expected
}
`"
desc
<<
(
"--- YAML DIFF "
<<
"-"
*
65
)
diffy_diff
=
''
Diffy
::
Diff
.
new
(
expected
.
to_s
,
produced
.
to_s
,
:source
=>
'files'
,
:context
=>
3
).
each
do
|
line
|
case
line
when
/^\+/
then
diffy_diff
<<
line
.
green
when
/^-/
then
diffy_diff
<<
line
.
red
else
diffy_diff
<<
line
unless
expected_yaml
==
produced_yaml
desc
<<
"YAML comparison error `
#{
expected
}
`"
desc
<<
(
"--- YAML DIFF "
<<
"-"
*
65
)
diffy_diff
=
''
Diffy
::
Diff
.
new
(
expected
.
to_s
,
produced
.
to_s
,
:source
=>
'files'
,
:context
=>
3
).
each
do
|
line
|
case
line
when
/^\+/
then
diffy_diff
<<
line
.
green
when
/^-/
then
diffy_diff
<<
line
.
red
else
diffy_diff
<<
line
end
end
desc
<<
diffy_diff
desc
<<
(
"--- XCODEPROJ DIFF "
<<
"-"
*
60
)
diff_options
=
{
:key_1
=>
"$produced"
,
:key_2
=>
"$expected"
}
diff
=
Xcodeproj
::
Differ
.
diff
(
produced_yaml
,
expected_yaml
,
diff_options
).
to_yaml
diff
.
gsub!
(
"$produced"
,
"produced"
.
green
)
diff
.
gsub!
(
"$expected"
,
"expected"
.
red
)
desc
<<
diff
desc
<<
(
"--- END "
<<
"-"
*
70
)
end
desc
<<
diffy_diff
desc
<<
(
"--- XCODEPROJ DIFF "
<<
"-"
*
60
)
diff_options
=
{
:key_1
=>
"$produced"
,
:key_2
=>
"$expected"
}
diff
=
Xcodeproj
::
Differ
.
diff
(
produced_yaml
,
expected_yaml
,
diff_options
).
to_yaml
diff
.
gsub!
(
"$produced"
,
"produced"
.
green
)
diff
.
gsub!
(
"$expected"
,
"expected"
.
red
)
desc
<<
diff
desc
<<
(
"--- END "
<<
"-"
*
70
)
expected_yaml
.
should
.
satisfy
(
desc
*
"
\n\n
"
)
do
if
RUBY_VERSION
<
"1.9"
...
...
@@ -255,18 +258,20 @@ end
def
file_should_match
(
expected
,
produced
)
is_equal
=
FileUtils
.
compare_file
(
expected
,
produced
)
description
=
[]
description
<<
"File comparison error `
#{
expected
}
`"
description
<<
""
description
<<
(
"--- DIFF "
<<
"-"
*
70
)
Diffy
::
Diff
.
new
(
expected
.
to_s
,
produced
.
to_s
,
:source
=>
'files'
,
:context
=>
3
).
each
do
|
line
|
case
line
when
/^\+/
then
description
<<
line
.
gsub
(
"
\n
"
,
''
).
green
when
/^-/
then
description
<<
line
.
gsub
(
"
\n
"
,
''
).
red
else
description
<<
line
.
gsub
(
"
\n
"
,
''
)
unless
is_equal
description
<<
"File comparison error `
#{
expected
}
`"
description
<<
""
description
<<
(
"--- DIFF "
<<
"-"
*
70
)
Diffy
::
Diff
.
new
(
expected
.
to_s
,
produced
.
to_s
,
:source
=>
'files'
,
:context
=>
3
).
each
do
|
line
|
case
line
when
/^\+/
then
description
<<
line
.
gsub
(
"
\n
"
,
''
).
green
when
/^-/
then
description
<<
line
.
gsub
(
"
\n
"
,
''
).
red
else
description
<<
line
.
gsub
(
"
\n
"
,
''
)
end
end
description
<<
(
"--- END "
<<
"-"
*
70
)
description
<<
""
end
description
<<
(
"--- END "
<<
"-"
*
70
)
description
<<
""
is_equal
.
should
.
satisfy
(
description
*
"
\n
"
)
do
is_equal
==
true
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment