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| ...@@ -8,17 +8,16 @@ RSpec::Matchers.define :have_column do |column_name|
column && column.default.to_s == @default.to_s column && column.default.to_s == @default.to_s
end end
failure_message_method =
if RSpec::Version::STRING.to_i >= 3 if RSpec::Version::STRING.to_i >= 3
failure_message do |columns| :failure_message
"expected to find '#{column_name}', " +
"default '#{@default}' " +
"in #{columns.map { |column| [column.name, column.default] }}"
end
else else
failure_message_for_should do |columns| :failure_message_for_should
end
send(failure_message_method) do |columns|
"expected to find '#{column_name}', " + "expected to find '#{column_name}', " +
"default '#{@default}' " + "default '#{@default}' " +
"in #{columns.map { |column| [column.name, column.default] }}" "in #{columns.map { |column| [column.name, column.default] }}"
end end
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