Commit afbb3af3 by Jon Yurek

RSpec 2 and 3 have the same message format on failure

parent 65b77763
......@@ -8,17 +8,16 @@ RSpec::Matchers.define :have_column do |column_name|
column && column.default.to_s == @default.to_s
end
failure_message_method =
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
:failure_message
else
failure_message_for_should do |columns|
: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
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