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
if RSpec::Version::STRING.to_i >= 3 failure_message_method =
failure_message do |columns| if RSpec::Version::STRING.to_i >= 3
"expected to find '#{column_name}', " + :failure_message
"default '#{@default}' " + else
"in #{columns.map { |column| [column.name, column.default] }}" :failure_message_for_should
end
else
failure_message_for_should do |columns|
"expected to find '#{column_name}', " +
"default '#{@default}' " +
"in #{columns.map { |column| [column.name, column.default] }}"
end 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 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