database_cleaner 1.7.0 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTE.markdown +1 -2
  3. data/Gemfile.lock +130 -91
  4. data/History.rdoc +45 -1
  5. data/README.markdown +74 -226
  6. data/Rakefile +12 -8
  7. data/adapters/database_cleaner-active_record/lib/database_cleaner-active_record.rb +1 -0
  8. data/adapters/database_cleaner-active_record/lib/database_cleaner/active_record.rb +6 -0
  9. data/{lib → adapters/database_cleaner-active_record/lib}/database_cleaner/active_record/base.rb +13 -4
  10. data/{lib → adapters/database_cleaner-active_record/lib}/database_cleaner/active_record/deletion.rb +19 -19
  11. data/{lib → adapters/database_cleaner-active_record/lib}/database_cleaner/active_record/transaction.rb +0 -0
  12. data/{lib → adapters/database_cleaner-active_record/lib}/database_cleaner/active_record/truncation.rb +25 -20
  13. data/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/version.rb +5 -0
  14. data/adapters/database_cleaner-couch_potato/lib/database_cleaner-couch_potato.rb +1 -0
  15. data/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato.rb +11 -0
  16. data/{lib → adapters/database_cleaner-couch_potato/lib}/database_cleaner/couch_potato/base.rb +0 -0
  17. data/{lib → adapters/database_cleaner-couch_potato/lib}/database_cleaner/couch_potato/truncation.rb +0 -0
  18. data/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/version.rb +5 -0
  19. data/adapters/database_cleaner-data_mapper/lib/database_cleaner-data_mapper.rb +1 -0
  20. data/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper.rb +4 -0
  21. data/{lib → adapters/database_cleaner-data_mapper/lib}/database_cleaner/data_mapper/base.rb +4 -0
  22. data/{lib → adapters/database_cleaner-data_mapper/lib}/database_cleaner/data_mapper/transaction.rb +0 -0
  23. data/{lib → adapters/database_cleaner-data_mapper/lib}/database_cleaner/data_mapper/truncation.rb +4 -3
  24. data/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/version.rb +5 -0
  25. data/adapters/database_cleaner-mongo/lib/database_cleaner-mongo.rb +1 -0
  26. data/adapters/database_cleaner-mongo/lib/database_cleaner/mongo.rb +10 -0
  27. data/{lib → adapters/database_cleaner-mongo/lib}/database_cleaner/mongo/base.rb +0 -0
  28. data/{lib → adapters/database_cleaner-mongo/lib}/database_cleaner/mongo/truncation.rb +2 -0
  29. data/{lib → adapters/database_cleaner-mongo/lib}/database_cleaner/mongo/truncation_mixin.rb +0 -0
  30. data/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/version.rb +5 -0
  31. data/adapters/database_cleaner-mongo_mapper/lib/database_cleaner-mongo_mapper.rb +1 -0
  32. data/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper.rb +4 -0
  33. data/{lib → adapters/database_cleaner-mongo_mapper/lib}/database_cleaner/mongo_mapper/base.rb +4 -0
  34. data/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/truncation.rb +35 -0
  35. data/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/version.rb +5 -0
  36. data/adapters/database_cleaner-mongoid/lib/database_cleaner-mongoid.rb +1 -0
  37. data/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid.rb +10 -0
  38. data/{lib → adapters/database_cleaner-mongoid/lib}/database_cleaner/mongoid/base.rb +0 -0
  39. data/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongo1_truncation_mixin.rb +26 -0
  40. data/{lib/database_cleaner/mongo2/truncation_mixin.rb → adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongo2_truncation_mixin.rb} +3 -4
  41. data/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/mongoid_truncation_mixin.rb +65 -0
  42. data/{lib → adapters/database_cleaner-mongoid/lib}/database_cleaner/mongoid/truncation.rb +6 -6
  43. data/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/version.rb +5 -0
  44. data/adapters/database_cleaner-moped/lib/database_cleaner-moped.rb +1 -0
  45. data/adapters/database_cleaner-moped/lib/database_cleaner/moped.rb +10 -0
  46. data/{lib → adapters/database_cleaner-moped/lib}/database_cleaner/moped/base.rb +1 -1
  47. data/{lib → adapters/database_cleaner-moped/lib}/database_cleaner/moped/truncation.rb +0 -0
  48. data/{lib → adapters/database_cleaner-moped/lib}/database_cleaner/moped/truncation_base.rb +4 -0
  49. data/adapters/database_cleaner-moped/lib/database_cleaner/moped/version.rb +5 -0
  50. data/adapters/database_cleaner-neo4j/lib/database_cleaner-neo4j.rb +1 -0
  51. data/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j.rb +6 -0
  52. data/{lib → adapters/database_cleaner-neo4j/lib}/database_cleaner/neo4j/base.rb +4 -0
  53. data/{lib → adapters/database_cleaner-neo4j/lib}/database_cleaner/neo4j/deletion.rb +0 -0
  54. data/{lib → adapters/database_cleaner-neo4j/lib}/database_cleaner/neo4j/transaction.rb +0 -0
  55. data/{lib → adapters/database_cleaner-neo4j/lib}/database_cleaner/neo4j/truncation.rb +0 -0
  56. data/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/version.rb +5 -0
  57. data/adapters/database_cleaner-ohm/lib/database_cleaner-ohm.rb +1 -0
  58. data/adapters/database_cleaner-ohm/lib/database_cleaner/ohm.rb +12 -0
  59. data/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/truncation.rb +24 -0
  60. data/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/version.rb +5 -0
  61. data/adapters/database_cleaner-redis/lib/database_cleaner-redis.rb +1 -0
  62. data/adapters/database_cleaner-redis/lib/database_cleaner/redis.rb +4 -0
  63. data/{lib → adapters/database_cleaner-redis/lib}/database_cleaner/redis/base.rb +4 -0
  64. data/{lib → adapters/database_cleaner-redis/lib}/database_cleaner/redis/truncation.rb +0 -0
  65. data/adapters/database_cleaner-redis/lib/database_cleaner/redis/version.rb +5 -0
  66. data/adapters/database_cleaner-sequel/lib/database_cleaner-sequel.rb +1 -0
  67. data/adapters/database_cleaner-sequel/lib/database_cleaner/sequel.rb +6 -0
  68. data/{lib → adapters/database_cleaner-sequel/lib}/database_cleaner/sequel/base.rb +4 -0
  69. data/{lib → adapters/database_cleaner-sequel/lib}/database_cleaner/sequel/deletion.rb +0 -0
  70. data/{lib → adapters/database_cleaner-sequel/lib}/database_cleaner/sequel/transaction.rb +0 -0
  71. data/{lib → adapters/database_cleaner-sequel/lib}/database_cleaner/sequel/truncation.rb +16 -15
  72. data/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/version.rb +5 -0
  73. data/lib/database_cleaner.rb +36 -1
  74. data/lib/database_cleaner/base.rb +92 -105
  75. data/lib/database_cleaner/configuration.rb +87 -83
  76. data/lib/database_cleaner/deprecation.rb +26 -0
  77. data/lib/database_cleaner/null_strategy.rb +6 -6
  78. data/lib/database_cleaner/orm_autodetector.rb +41 -0
  79. data/lib/database_cleaner/safeguard.rb +38 -3
  80. data/lib/database_cleaner/spec.rb +2 -0
  81. data/lib/database_cleaner/spec/database_helper.rb +82 -0
  82. data/lib/database_cleaner/spec/shared_examples.rb +15 -0
  83. data/lib/database_cleaner/version.rb +3 -0
  84. metadata +111 -44
  85. data/VERSION.yml +0 -4
  86. data/lib/database_cleaner/mongo2/base.rb +0 -16
  87. data/lib/database_cleaner/mongo_mapper/truncation.rb +0 -19
  88. data/lib/database_cleaner/ohm/truncation.rb +0 -15
data/VERSION.yml DELETED
@@ -1,4 +0,0 @@
1
- ---
2
- :major: 1
3
- :minor: 7
4
- :patch: 0
@@ -1,16 +0,0 @@
1
- module DatabaseCleaner
2
- module Mongo2
3
- def self.available_strategies
4
- %w[truncation]
5
- end
6
- module Base
7
- def db=(desired_db)
8
- @db = desired_db
9
- end
10
-
11
- def db
12
- @db || raise("You have not specified a database. (see Mongo2::Database)")
13
- end
14
- end
15
- end
16
- end
@@ -1,19 +0,0 @@
1
- require 'database_cleaner/mongo_mapper/base'
2
- require 'database_cleaner/generic/truncation'
3
- require 'database_cleaner/mongo/truncation_mixin'
4
-
5
- module DatabaseCleaner
6
- module MongoMapper
7
- class Truncation
8
- include ::DatabaseCleaner::MongoMapper::Base
9
- include ::DatabaseCleaner::Generic::Truncation
10
- include ::DatabaseCleaner::Mongo::TruncationMixin
11
-
12
- private
13
-
14
- def database
15
- ::MongoMapper.database
16
- end
17
- end
18
- end
19
- end
@@ -1,15 +0,0 @@
1
- require 'database_cleaner/redis/truncation'
2
-
3
- module DatabaseCleaner
4
- module Ohm
5
- class Truncation < ::DatabaseCleaner::Redis::Truncation
6
-
7
- private
8
-
9
- def default_redis
10
- ::Ohm.redis
11
- end
12
-
13
- end
14
- end
15
- end