Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
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
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
afbb3af3
Commit
afbb3af3
authored
Apr 30, 2015
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RSpec 2 and 3 have the same message format on failure
parent
65b77763
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
spec/support/matchers/have_column.rb
+10
-11
No files found.
spec/support/matchers/have_column.rb
View file @
afbb3af3
...
...
@@ -8,17 +8,16 @@ RSpec::Matchers.define :have_column do |column_name|
column
&&
column
.
default
.
to_s
==
@default
.
to_s
end
if
RSpec
::
Version
::
STRING
.
to_i
>=
3
failure_message
do
|
columns
|
"expected to find '
#{
column_name
}
', "
+
"default '
#{
@default
}
' "
+
"in
#{
columns
.
map
{
|
column
|
[
column
.
name
,
column
.
default
]
}
}"
end
else
failure_message_for_should
do
|
columns
|
"expected to find '
#{
column_name
}
', "
+
"default '
#{
@default
}
' "
+
"in
#{
columns
.
map
{
|
column
|
[
column
.
name
,
column
.
default
]
}
}"
failure_message_method
=
if
RSpec
::
Version
::
STRING
.
to_i
>=
3
:failure_message
else
:failure_message_for_should
end
send
(
failure_message_method
)
do
|
columns
|
"expected to find '
#{
column_name
}
', "
+
"default '
#{
@default
}
' "
+
"in
#{
columns
.
map
{
|
column
|
[
column
.
name
,
column
.
default
]
}
}"
end
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