Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/remockable/active_record/have_column.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ def column
}
end

def column_values_match?(key, value)
case key
when :default
subject.class.column_defaults[column.name] == value
else
column.send(key) == value
end
end

match do |actual|
if column
options.all? { |key, value| column.send(key) == value }
options.all? { |key, value| column_values_match?(key, value) }
end
end

Expand Down