Permalink
Browse files

fix failing test, change passing test

(But I'm not done yet.)
  • Loading branch information...
1 parent 3857bc6 commit 8f499de29ba63a165bbee765882621f774869880 @xpe xpe committed Feb 7, 2013
@@ -2,7 +2,8 @@ module Foreigner
module ConnectionAdapters
module TableDefinition
def foreign_key(to_table, options = {})
- foreign_keys[to_table] = options
+ foreign_keys[to_table] ||= []
+ foreign_keys[to_table] << options
end
def foreign_keys
@@ -8,7 +8,7 @@ class TestDefinition
test "foreign_key used once" do
definition = TestDefinition.new
definition.foreign_key :poops, and: :one;
- assert_equal({ and: :one }, definition.foreign_keys[:poops])
+ assert_equal [{ and: :one }], definition.foreign_keys[:poops]
end
test "foreign_key used twice" do

0 comments on commit 8f499de

Please sign in to comment.