Sha256: 9b5bba16f691fe4948eb6cedd7b0ecfb20bfd68feb8f6e6f68fa68c065e8b52f
Contents?: true
Size: 605 Bytes
Versions: 22
Compression:
Stored size: 605 Bytes
Contents
RSpec::Matchers.define :have_column do |column_name| chain :with_default do |default| @default = default end match do |columns| column = columns.detect{|column| column.name == column_name } column && column.default.to_s == @default.to_s end 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
Version data entries
22 entries across 22 versions & 5 rubygems