· 7 years ago · Oct 21, 2018, 06:32 AM
1Apartment::Adapters::Mysql2Adapter
2 it should behave like a generic apartment adapter
3 #create
4 should create the new databases
5 should load schema.rb to new schema
6 should yield to block if passed and reset
7 #drop
8 should remove the db
9 #process
10 should connect
11 should reset
12 should not throw exception if current_database is no longer accessible
13 #reset
14 should reset connection
15 #switch
16 should connect to new db
17 should reset connection if database is nil
18 #current_database
19 should return the current db name
20 it should behave like a db based apartment adapter
21 #init
22 should process model exclusions
23 #drop
24 should raise an error for unknown database
25 #switch
26 should raise an error if database is invalid
27
28Apartment::Adapters::PostgresqlAdapter
29 using schemas
30 it should behave like a generic apartment adapter
31 #create
32 should create the new databases
33 should load schema.rb to new schema
34 should yield to block if passed and reset
35 #drop
36 should remove the db
37 #process
38 should connect
39 should reset
40 should not throw exception if current_database is no longer accessible
41 #reset
42 should reset connection
43 #switch
44 should connect to new db
45 should reset connection if database is nil
46 #current_database
47 should return the current db name
48 it should behave like a schema based apartment adapter
49 #init
50 should process model exclusions
51 with a default_schema
52 should set the proper table_name on excluded_models
53 #create
54 should load schema.rb to new schema
55 should yield to block if passed and reset
56 numeric database names
57 should allow them
58 #drop
59 should raise an error for unknown database
60 numeric database names
61 should be able to drop them
62 #process
63 should connect
64 should reset
65 #reset
66 should reset connection
67 with default_schema
68 should reset to the default schema
69 persistent_schemas
70 maintains the persistent schemas in the schema_search_path
71 with default_schema
72 prioritizes the switched schema to front of schema_search_path
73 #switch
74 should connect to new schema
75 should reset connection if database is nil
76 should raise an error if schema is invalid
77 numeric databases
78 should connect to them
79 with default_schema specified
80 should switch out the default schema rather than public
81 should still switch to the switched schema
82 persistent_schemas
83 maintains the persistent schemas in the schema_search_path
84 prioritizes the switched schema to front of schema_search_path
85 #current_database
86 should return the current schema name
87 persistent_schemas
88 should exlude persistent_schemas
89 using databases
90 it should behave like a generic apartment adapter
91 #create
92 should create the new databases (FAILED - 1)
93 should load schema.rb to new schema (FAILED - 2)
94 should yield to block if passed and reset (FAILED - 3)
95 #drop
96 should remove the db (FAILED - 4)
97 #process
98 should connect (FAILED - 5)
99 should reset (FAILED - 6)
100 should not throw exception if current_database is no longer accessible (FAILED - 7)
101 #reset
102 should reset connection (FAILED - 8)
103 #switch
104 should connect to new db (FAILED - 9)
105 should reset connection if database is nil (FAILED - 10)
106 #current_database
107 should return the current db name (FAILED - 11)
108 it should behave like a db based apartment adapter
109 #init
110 should process model exclusions (FAILED - 12)
111 #drop
112 should raise an error for unknown database (FAILED - 13)
113 #switch
114 should raise an error if database is invalid (FAILED - 14)
115
116Apartment
117 should be valid
118 should be a valid app
119
120Apartment::Database
121 using mysql
122 #adapter
123 should load mysql adapter
124 using postgresql
125 #adapter
126 should load postgresql adapter
127 should raise exception with invalid adapter specified
128 with schemas
129 #create
130 should seed data
131 #switch
132 creating models
133 should create a model instance in the current schema
134 with excluded models
135 should create excluded models in public schema
136
137apartment rake tasks
138 with x number of databases
139 #migrate
140== CreateDummyModels: migrating ==============================================
141-- create_table(:companies)
142 should migrate all databases (FAILED - 15)
143 #rollback
144Rolling back db138 database
145Rolling back db139 database
146Rolling back db140 database
147== CreateDummyModels: migrating ==============================================
148-- create_table(:companies)
149 should rollback all dbs (FAILED - 16)
150 apartment:seed
151You have 2 pending migrations:
152 20110613152810 CreateDummyModels
153 20111202022214 CreateTableBooks
154Run `rake db:migrate` to update your database then try again.
155 should seed all databases (FAILED - 17)
156
157Apartment::Delayed
158 Apartment::Delayed::Requirements
159 should initialize a database attribute on a class
160 should not overwrite any previous after_initialize declarations
161 should set the db on a new record before it saves
162 serialization
163 should serialize the proper database attribute
164 Apartment::Delayed::Job::Hooks
165 should switch to previous db
166
167Apartment::Elevators::Domain
168 it should behave like an apartment elevator
169 single request
170 should switch the db
171 simultaneous requests
172 should fetch the correct user count for each session based on the elevator processor
173
174Apartment::Elevators::Generic
175 it should behave like an apartment elevator
176 single request
177 should switch the db
178 simultaneous requests
179 should fetch the correct user count for each session based on the elevator processor
180
181Apartment::Elevators::Subdomain
182 it should behave like an apartment elevator
183 single request
184 should switch the db
185 simultaneous requests
186 should fetch the correct user count for each session based on the elevator processor
187
188apartment rake tasks
189 database migration
190 apartment:migrate
191Migrating db165 database
192Migrating db166 database
193Migrating db167 database
194 should migrate public and all multi-tenant dbs
195 apartment:migrate:up
196 without a version
197 requires a version to migrate to
198 with version
199Migrating db171 database up
200Migrating db172 database up
201Migrating db173 database up
202 migrates up to a specific version
203 apartment:migrate:down
204 without a version
205 requires a version to migrate to
206 with version
207Migrating db177 database down
208Migrating db178 database down
209Migrating db179 database down
210 migrates up to a specific version
211 apartment:rollback
212Rolling back db180 database
213Rolling back db181 database
214Rolling back db182 database
215 should rollback dbs
216Rolling back db183 database
217Rolling back db184 database
218Rolling back db185 database
219 should rollback dbs STEP amt
220
221Apartment
222 #config
223 should yield the Apartment object
224 should set excluded models
225 should set postgres_schemas
226 should set seed_after_create
227 databases
228 should return object if it doesnt respond_to call
229 should invoke the proc if appropriate
230 should return the invoked proc if appropriate
231
232Apartment::Elevators::Domain
233 #parse_database_name
234 parses the host for a domain name
235 ignores a www prefix and domain suffix
236 returns nil if there is no host
237
238Apartment::Elevators::Subdomain
239 #parse_database_name
240 should parse subdomain
241 should return nil when no subdomain
242
243Apartment::Migrator
244 postgresql
245 using schemas
246 #migrate
247 should connect to new db, then reset when done (FAILED - 18)
248 should migrate db
249 #run
250 up
251 should connect to new db, then reset when done (FAILED - 19)
252 should migrate to a version
253 down
254 should connect to new db, then reset when done
255 should migrate to a version
256 #rollback
257 should rollback the db
258
259Apartment::Reloader
260 using postgresql schemas
261 should initialize apartment when called
262
263Failures:
264
265 1) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#create should create the new databases
266 Failure/Error: Unable to find matching line from backtrace
267 Apartment::DatabaseExists:
268 The database db102 already exists.
269 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
270 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
271 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
272 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
273 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
274
275 2) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#create should load schema.rb to new schema
276 Failure/Error: Unable to find matching line from backtrace
277 Apartment::DatabaseExists:
278 The database db104 already exists.
279 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
280 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
281 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
282 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
283 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
284
285 3) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#create should yield to block if passed and reset
286 Failure/Error: Unable to find matching line from backtrace
287 Apartment::DatabaseExists:
288 The database db106 already exists.
289 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
290 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
291 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
292 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
293 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
294
295 4) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#drop should remove the db
296 Failure/Error: Unable to find matching line from backtrace
297 Apartment::DatabaseExists:
298 The database db108 already exists.
299 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
300 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
301 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
302 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
303 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
304
305 5) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#process should connect
306 Failure/Error: Unable to find matching line from backtrace
307 Apartment::DatabaseExists:
308 The database db110 already exists.
309 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
310 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
311 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
312 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
313 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
314
315 6) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#process should reset
316 Failure/Error: Unable to find matching line from backtrace
317 Apartment::DatabaseExists:
318 The database db112 already exists.
319 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
320 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
321 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
322 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
323 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
324
325 7) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#process should not throw exception if current_database is no longer accessible
326 Failure/Error: Unable to find matching line from backtrace
327 Apartment::DatabaseExists:
328 The database db114 already exists.
329 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
330 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
331 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
332 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
333 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
334
335 8) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#reset should reset connection
336 Failure/Error: Unable to find matching line from backtrace
337 Apartment::DatabaseExists:
338 The database db116 already exists.
339 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
340 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
341 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
342 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
343 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
344
345 9) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#switch should connect to new db
346 Failure/Error: Unable to find matching line from backtrace
347 Apartment::DatabaseExists:
348 The database db118 already exists.
349 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
350 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
351 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
352 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
353 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
354
355 10) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#switch should reset connection if database is nil
356 Failure/Error: Unable to find matching line from backtrace
357 Apartment::DatabaseExists:
358 The database db120 already exists.
359 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
360 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
361 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
362 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
363 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
364
365 11) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#current_database should return the current db name
366 Failure/Error: Unable to find matching line from backtrace
367 Apartment::DatabaseExists:
368 The database db122 already exists.
369 Shared Example Group: "a generic apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:35
370 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
371 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
372 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
373 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
374
375 12) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a db based apartment adapter#init should process model exclusions
376 Failure/Error: Unable to find matching line from backtrace
377 Apartment::DatabaseExists:
378 The database db124 already exists.
379 Shared Example Group: "a db based apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:36
380 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
381 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
382 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
383 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
384
385 13) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a db based apartment adapter#drop should raise an error for unknown database
386 Failure/Error: Unable to find matching line from backtrace
387 Apartment::DatabaseExists:
388 The database db126 already exists.
389 Shared Example Group: "a db based apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:36
390 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
391 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
392 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
393 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
394
395 14) Apartment::Adapters::PostgresqlAdapter using databases it should behave like a db based apartment adapter#switch should raise an error if database is invalid
396 Failure/Error: Unable to find matching line from backtrace
397 Apartment::DatabaseExists:
398 The database db128 already exists.
399 Shared Example Group: "a db based apartment adapter" called from ./spec/adapters/postgresql_adapter_spec.rb:36
400 # ./lib/apartment/adapters/abstract_adapter.rb:118:in `rescue in create_database'
401 # ./lib/apartment/adapters/abstract_adapter.rb:115:in `create_database'
402 # ./lib/apartment/adapters/abstract_adapter.rb:23:in `create'
403 # ./spec/support/requirements.rb:20:in `block (2 levels) in <module:AdapterRequirements>'
404
405 15) apartment rake tasks with x number of databases#migrate should migrate all databases
406 Failure/Error: @rake['apartment:migrate'].invoke
407 StandardError:
408 An error has occurred, this and all later migrations canceled:
409
410 PG::Error: ERROR: relation "companies" already exists
411 : CREATE TABLE "companies" ("id" serial primary key, "dummy" boolean, "database" character varying(255))
412 # ./spec/dummy/db/migrate/20110613152810_create_dummy_models.rb:3:in `up'
413 # ./spec/integration/apartment_rake_integration_spec.rb:51:in `block (4 levels) in <top (required)>'
414
415 16) apartment rake tasks with x number of databases#rollback should rollback all dbs
416 Failure/Error: @rake['apartment:migrate'].invoke # migrate again so that our next test 'seed' can run (requires migrations to be complete)
417 StandardError:
418 An error has occurred, this and all later migrations canceled:
419
420 PG::Error: ERROR: relation "companies" already exists
421 : CREATE TABLE "companies" ("id" serial primary key, "dummy" boolean, "database" character varying(255))
422 # ./spec/dummy/db/migrate/20110613152810_create_dummy_models.rb:3:in `up'
423 # ./spec/integration/apartment_rake_integration_spec.rb:62:in `block (4 levels) in <top (required)>'
424
425 17) apartment rake tasks with x number of databases apartment:seed should seed all databases
426 Failure/Error: @rake['apartment:seed'].invoke
427 SystemExit:
428 Run `rake db:migrate` to update your database then try again.
429 # ./spec/integration/apartment_rake_integration_spec.rb:70:in `block (4 levels) in <top (required)>'
430
431 18) Apartment::Migrator postgresql using schemas#migrate should connect to new db, then reset when done
432 Failure/Error: Apartment::Migrator.migrate(schema_name)
433 StandardError:
434 An error has occurred, this and all later migrations canceled:
435
436 PG::Error: ERROR: relation "companies" already exists
437 : CREATE TABLE "companies" ("id" serial primary key, "dummy" boolean, "database" character varying(255))
438 # ./spec/dummy/db/migrate/20110613152810_create_dummy_models.rb:3:in `up'
439 # ./lib/apartment/migrator.rb:9:in `block in migrate'
440 # ./lib/apartment/adapters/abstract_adapter.rb:62:in `process'
441 # ./lib/apartment/database.rb:11:in `process'
442 # ./lib/apartment/migrator.rb:9:in `migrate'
443 # ./spec/unit/migrator_spec.rb:37:in `block (5 levels) in <top (required)>'
444
445 19) Apartment::Migrator postgresql using schemas#run up should connect to new db, then reset when done
446 Failure/Error: Apartment::Migrator.run(:up, schema_name, version)
447 ActiveRecord::StatementInvalid:
448 PG::Error: ERROR: relation "companies" already exists
449 : CREATE TABLE "companies" ("id" serial primary key, "dummy" boolean, "database" character varying(255))
450 # ./spec/dummy/db/migrate/20110613152810_create_dummy_models.rb:3:in `up'
451 # ./lib/apartment/migrator.rb:14:in `block in run'
452 # ./lib/apartment/adapters/abstract_adapter.rb:62:in `process'
453 # ./lib/apartment/database.rb:11:in `process'
454 # ./lib/apartment/migrator.rb:14:in `run'
455 # ./spec/unit/migrator_spec.rb:52:in `block (6 levels) in <top (required)>'
456
457Finished in 28.45 seconds
458111 examples, 19 failures
459
460Failed examples:
461
462rspec ./spec/examples/generic_adapter_examples.rb:13 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#create should create the new databases
463rspec ./spec/examples/generic_adapter_examples.rb:18 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#create should load schema.rb to new schema
464rspec ./spec/examples/generic_adapter_examples.rb:24 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#create should yield to block if passed and reset
465rspec ./spec/examples/generic_adapter_examples.rb:42 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#drop should remove the db
466rspec ./spec/examples/generic_adapter_examples.rb:49 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#process should connect
467rspec ./spec/examples/generic_adapter_examples.rb:55 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#process should reset
468rspec ./spec/examples/generic_adapter_examples.rb:62 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#process should not throw exception if current_database is no longer accessible
469rspec ./spec/examples/generic_adapter_examples.rb:72 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#reset should reset connection
470rspec ./spec/examples/generic_adapter_examples.rb:80 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#switch should connect to new db
471rspec ./spec/examples/generic_adapter_examples.rb:85 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#switch should reset connection if database is nil
472rspec ./spec/examples/generic_adapter_examples.rb:92 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a generic apartment adapter#current_database should return the current db name
473rspec ./spec/examples/db_adapter_examples.rb:10 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a db based apartment adapter#init should process model exclusions
474rspec ./spec/examples/db_adapter_examples.rb:22 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a db based apartment adapter#drop should raise an error for unknown database
475rspec ./spec/examples/db_adapter_examples.rb:30 # Apartment::Adapters::PostgresqlAdapter using databases it should behave like a db based apartment adapter#switch should raise an error if database is invalid
476rspec ./spec/integration/apartment_rake_integration_spec.rb:48 # apartment rake tasks with x number of databases#migrate should migrate all databases
477rspec ./spec/integration/apartment_rake_integration_spec.rb:56 # apartment rake tasks with x number of databases#rollback should rollback all dbs
478rspec ./spec/integration/apartment_rake_integration_spec.rb:67 # apartment rake tasks with x number of databases apartment:seed should seed all databases
479rspec ./spec/unit/migrator_spec.rb:34 # Apartment::Migrator postgresql using schemas#migrate should connect to new db, then reset when done
480rspec ./spec/unit/migrator_spec.rb:49 # Apartment::Migrator postgresql using schemas#run up should connect to new db, then reset when done