@@ -96,22 +96,22 @@ def self.clean?(test_rig)
96
96
97
97
def mock_index ( name , params = { } )
98
98
double ( 'IndexKeyDefinition' ,
99
- name : name ,
100
- columns : params [ :columns ] || [ ] ,
101
- unique : params [ :unique ] || false ,
102
- orders : params [ :orders ] || { } ,
103
- where : params [ :where ] ,
104
- using : params [ :using ] )
99
+ name : name ,
100
+ columns : params [ :columns ] || [ ] ,
101
+ unique : params [ :unique ] || false ,
102
+ orders : params [ :orders ] || { } ,
103
+ where : params [ :where ] ,
104
+ using : params [ :using ] )
105
105
end
106
106
107
107
def mock_foreign_key ( name , from_column , to_table , to_column = 'id' , constraints = { } )
108
108
double ( 'ForeignKeyDefinition' ,
109
- name : name ,
110
- column : from_column ,
111
- to_table : to_table ,
112
- primary_key : to_column ,
113
- on_delete : constraints [ :on_delete ] ,
114
- on_update : constraints [ :on_update ] )
109
+ name : name ,
110
+ column : from_column ,
111
+ to_table : to_table ,
112
+ primary_key : to_column ,
113
+ on_delete : constraints [ :on_delete ] ,
114
+ on_update : constraints [ :on_update ] )
115
115
end
116
116
117
117
def mock_connection ( indexes = [ ] , foreign_keys = [ ] )
@@ -123,13 +123,13 @@ def mock_connection(indexes = [], foreign_keys = [])
123
123
124
124
def mock_class ( table_name , primary_key , columns , indexes = [ ] , foreign_keys = [ ] )
125
125
options = {
126
- connection : mock_connection ( indexes , foreign_keys ) ,
127
- table_exists? : true ,
128
- table_name : table_name ,
129
- primary_key : primary_key ,
130
- column_names : columns . map { |col | col . name . to_s } ,
131
- columns : columns ,
132
- column_defaults : Hash [ columns . map { |col | [ col . name , col . default ] } ] ,
126
+ connection : mock_connection ( indexes , foreign_keys ) ,
127
+ table_exists? : true ,
128
+ table_name : table_name ,
129
+ primary_key : primary_key ,
130
+ column_names : columns . map { |col | col . name . to_s } ,
131
+ columns : columns ,
132
+ column_defaults : Hash [ columns . map { |col | [ col . name , col . default ] } ] ,
133
133
table_name_prefix : ''
134
134
}
135
135
0 commit comments