Skip to content

Commit

Permalink
Rspec2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
soramugi authored and Jon Yurek committed Apr 30, 2015
1 parent 3fbda79 commit 108fe47
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/support/matchers/have_column.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
column && column.default.to_s == @default.to_s
end

failure_message do |columns|
"expected to find '#{column_name}', default '#{@default}' in #{columns.map{|column| [column.name, column.default] }}"
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] }}"
end
end
end

0 comments on commit 108fe47

Please sign in to comment.