database_cleaner 1.5.2 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile.lock +4 -4
  3. data/History.rdoc +44 -0
  4. data/README.markdown +29 -6
  5. data/VERSION.yml +2 -2
  6. data/lib/database_cleaner/active_record/base.rb +17 -1
  7. data/lib/database_cleaner/active_record/deletion.rb +23 -2
  8. data/lib/database_cleaner/active_record/truncation.rb +2 -2
  9. data/lib/database_cleaner/base.rb +2 -0
  10. data/lib/database_cleaner/mongoid/truncation.rb +1 -1
  11. data/lib/database_cleaner/null_strategy.rb +5 -0
  12. data/lib/database_cleaner/redis/base.rb +1 -1
  13. data/lib/database_cleaner/safeguard.rb +72 -0
  14. data/lib/database_cleaner.rb +6 -2
  15. metadata +6 -91
  16. data/examples/Gemfile +0 -1
  17. data/examples/Gemfile.lock +0 -286
  18. data/examples/config/database.yml +0 -7
  19. data/examples/config/database.yml.example +0 -8
  20. data/examples/config/redis.yml +0 -8
  21. data/examples/db/activerecord_one.db +0 -0
  22. data/examples/db/activerecord_two.db +0 -0
  23. data/examples/db/datamapper_default.db +0 -0
  24. data/examples/db/datamapper_one.db +0 -0
  25. data/examples/db/datamapper_two.db +0 -0
  26. data/examples/db/sqlite_databases_go_here +0 -0
  27. data/examples/features/example.feature +0 -11
  28. data/examples/features/example_multiple_db.feature +0 -23
  29. data/examples/features/example_multiple_orm.feature +0 -22
  30. data/examples/features/step_definitions/activerecord_steps.rb +0 -31
  31. data/examples/features/step_definitions/couchpotato_steps.rb +0 -31
  32. data/examples/features/step_definitions/datamapper_steps.rb +0 -37
  33. data/examples/features/step_definitions/mongoid_steps.rb +0 -23
  34. data/examples/features/step_definitions/mongomapper_steps.rb +0 -31
  35. data/examples/features/step_definitions/neo4j_steps.rb +0 -23
  36. data/examples/features/step_definitions/translation_steps.rb +0 -55
  37. data/examples/features/support/env.rb +0 -61
  38. data/examples/lib/activerecord_models.rb +0 -41
  39. data/examples/lib/couchpotato_models.rb +0 -61
  40. data/examples/lib/datamapper_models.rb +0 -50
  41. data/examples/lib/mongoid_models.rb +0 -44
  42. data/examples/lib/mongomapper_models.rb +0 -51
  43. data/examples/lib/neo4j_models.rb +0 -17
  44. data/examples/lib/ohm_models.rb +0 -43
  45. data/examples/lib/redis_models.rb +0 -65
  46. data/examples/lib/sequel_models.rb +0 -9
  47. data/features/cleaning.feature +0 -30
  48. data/features/cleaning_default_strategy.feature +0 -23
  49. data/features/cleaning_multiple_dbs.feature +0 -22
  50. data/features/cleaning_multiple_orms.feature +0 -67
  51. data/features/step_definitions/database_cleaner_steps.rb +0 -33
  52. data/features/step_definitions/ohm_steps.rb +0 -31
  53. data/features/step_definitions/redis_steps.rb +0 -31
  54. data/features/support/env.rb +0 -4
  55. data/features/support/feature_runner.rb +0 -39
  56. data/spec/database_cleaner/active_record/base_spec.rb +0 -188
  57. data/spec/database_cleaner/active_record/transaction_spec.rb +0 -176
  58. data/spec/database_cleaner/active_record/truncation/mysql2_spec.rb +0 -38
  59. data/spec/database_cleaner/active_record/truncation/mysql_spec.rb +0 -38
  60. data/spec/database_cleaner/active_record/truncation/postgresql_spec.rb +0 -75
  61. data/spec/database_cleaner/active_record/truncation/shared_fast_truncation.rb +0 -40
  62. data/spec/database_cleaner/active_record/truncation/sqlite3_spec.rb +0 -40
  63. data/spec/database_cleaner/active_record/truncation_spec.rb +0 -180
  64. data/spec/database_cleaner/base_spec.rb +0 -617
  65. data/spec/database_cleaner/configuration_spec.rb +0 -345
  66. data/spec/database_cleaner/couch_potato/truncation_spec.rb +0 -41
  67. data/spec/database_cleaner/data_mapper/base_spec.rb +0 -30
  68. data/spec/database_cleaner/data_mapper/transaction_spec.rb +0 -23
  69. data/spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb +0 -41
  70. data/spec/database_cleaner/data_mapper/truncation_spec.rb +0 -11
  71. data/spec/database_cleaner/generic/base_spec.rb +0 -61
  72. data/spec/database_cleaner/generic/truncation_spec.rb +0 -118
  73. data/spec/database_cleaner/mongo/mongo_examples.rb +0 -26
  74. data/spec/database_cleaner/mongo/truncation_spec.rb +0 -72
  75. data/spec/database_cleaner/mongo_mapper/base_spec.rb +0 -33
  76. data/spec/database_cleaner/mongo_mapper/mongo_examples.rb +0 -8
  77. data/spec/database_cleaner/mongo_mapper/truncation_spec.rb +0 -74
  78. data/spec/database_cleaner/moped/moped_examples.rb +0 -32
  79. data/spec/database_cleaner/moped/truncation_spec.rb +0 -80
  80. data/spec/database_cleaner/neo4j/base_spec.rb +0 -43
  81. data/spec/database_cleaner/neo4j/transaction_spec.rb +0 -25
  82. data/spec/database_cleaner/ohm/truncation_spec.rb +0 -70
  83. data/spec/database_cleaner/redis/base_spec.rb +0 -43
  84. data/spec/database_cleaner/redis/truncation_spec.rb +0 -63
  85. data/spec/database_cleaner/sequel/base_spec.rb +0 -32
  86. data/spec/database_cleaner/sequel/deletion_spec.rb +0 -58
  87. data/spec/database_cleaner/sequel/transaction_spec.rb +0 -21
  88. data/spec/database_cleaner/sequel/truncation/sqlite3_spec.rb +0 -0
  89. data/spec/database_cleaner/sequel/truncation_spec.rb +0 -182
  90. data/spec/database_cleaner/shared_strategy.rb +0 -15
  91. data/spec/rcov.opts +0 -1
  92. data/spec/spec_helper.rb +0 -21
  93. data/spec/support/active_record/database_setup.rb +0 -6
  94. data/spec/support/active_record/migrations/20150101010000_create_users.rb +0 -14
  95. data/spec/support/active_record/migrations/20150101020000_create_agents.rb +0 -14
  96. data/spec/support/active_record/mysql2_setup.rb +0 -39
  97. data/spec/support/active_record/mysql_setup.rb +0 -38
  98. data/spec/support/active_record/postgresql_setup.rb +0 -48
  99. data/spec/support/active_record/schema_setup.rb +0 -17
  100. data/spec/support/active_record/sqlite3_setup.rb +0 -40
  101. data/spec/support/data_mapper/schema_setup.rb +0 -15
  102. data/spec/support/data_mapper/sqlite3_setup.rb +0 -39
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2205055282f9fccb03b24e5d41985778c6f257a2
4
- data.tar.gz: 28d503c34fd8f35f9f9f46526e145dad8dc29534
2
+ SHA256:
3
+ metadata.gz: 5a0ef67709709d9ad8373dbc723dc3c5b965766a7e48b40badf5d4392558a6bd
4
+ data.tar.gz: 141f0a4e38d548ca0f100dd25f7c305cf459d87970eff5b8283d1a7b79eb0734
5
5
  SHA512:
6
- metadata.gz: cd0ce19c0e1cfb249aa59c816b2f482c6fd279c1f404043b1f1354488edd8e757650778241c3c5c0b81c92957fe10dd0e17a498323a5a0d2849508cebd846e2f
7
- data.tar.gz: eec65c6f11a279fe2f1bdf1a94c00f5dd245b5cfadb13c299487e2efe8494b62be1a47134677f3ccea3f02f355bf87e81a6fd8a846ada085191c86b281836efa
6
+ metadata.gz: f8161cfd306d227da75c2d997eeae124f191d9382b81a7e884ac43a5e272b4a931386427e700ef11af9f5416f6916c467c77104e46441b6b9a5e6329191c3516
7
+ data.tar.gz: 52f01680d172a214fa97d9f495c644b329014c74e53c862aa7aa7c91c26b0ca0769e684632997c564a2001f60fc212e03dabca789e0b27b3d1a93d1cd964f5aa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- database_cleaner (1.5.2)
4
+ database_cleaner (1.6.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -141,8 +141,8 @@ GEM
141
141
  httpclient (2.5.3.3)
142
142
  i18n (0.4.2)
143
143
  jdbc-sqlite3 (3.8.10.1)
144
- json (1.8.1)
145
- json (1.8.1-java)
144
+ json (1.8.6)
145
+ json (1.8.6-java)
146
146
  json_pure (1.8.1)
147
147
  listen (1.3.1)
148
148
  rb-fsevent (>= 0.9.3)
@@ -283,4 +283,4 @@ DEPENDENCIES
283
283
  tzinfo
284
284
 
285
285
  BUNDLED WITH
286
- 1.11.2
286
+ 1.15.0
data/History.rdoc CHANGED
@@ -1,5 +1,49 @@
1
1
  == Development (master)
2
2
 
3
+ === Bug Fixes
4
+ === Changes
5
+
6
+ == 1.7.0 2017-04-19
7
+
8
+ === Bug Fixes
9
+ * Remove unnecessary folders from gem: https://github.com/DatabaseCleaner/database_cleaner/pull/508
10
+ * Properly quote table names: https://github.com/DatabaseCleaner/database_cleaner/pull/501
11
+ * Use more idiomatic Ruby in README: https://github.com/DatabaseCleaner/database_cleaner/pull/510
12
+ * Return ::ActiveRecord::Base from `establish_connection`: https://github.com/DatabaseCleaner/database_cleaner/pull/399
13
+
14
+ === Changes
15
+ * Safeguard against running in production or running against a remote database: https://github.com/DatabaseCleaner/database_cleaner/pull/521
16
+
17
+ == 1.6.2 2017-10-29
18
+
19
+ === Bug Fixes
20
+ * ActiveRecord::Base namespace patch: https://github.com/DatabaseCleaner/database_cleaner/pull/490
21
+ * Better exclusion condition based on Rails version: https://github.com/DatabaseCleaner/database_cleaner/pull/487
22
+
23
+ === Changes
24
+ * Better documentation. Typos were fixed. Sequel deletion is supported: https://github.com/DatabaseCleaner/database_cleaner/pull/500
25
+
26
+ == 1.6.1 2017-05-09
27
+
28
+ === Bug Fixes
29
+ * Deletion strategy fix for ActiveRecord (@kawamoto)
30
+
31
+ == 1.6.0 2017-05-04
32
+
33
+ === New Features/Changes
34
+ * Rails 5.1 support: Remove deprecation warning (@activefx)
35
+ * MySQL 5.6+ InnoDB support (@ahorek)
36
+ * Better documentation (fixed typo) (@hoshinotsuyoshi)
37
+
38
+ === Bug Fixes
39
+ * Fix Redis db option (@soylent)
40
+ * Make NullStrategy API-complete (@anicholson)
41
+
42
+ == 1.5.3 2016-04-22
43
+
44
+ === Bug Fixes
45
+ * @P9GIT fixed issue #436
46
+
3
47
  == 1.5.2 2016-04-17
4
48
 
5
49
  === New Features/Changes
data/README.markdown CHANGED
@@ -65,7 +65,7 @@ Here is an overview of the strategies supported for each library:
65
65
  <td> Sequel</td>
66
66
  <td> <b>Yes</b></td>
67
67
  <td> Yes</td>
68
- <td> No</td>
68
+ <td> Yes</td>
69
69
  </tr>
70
70
  <tr>
71
71
  <td>Redis</td>
@@ -166,7 +166,7 @@ passed to [`keys`](http://redis.io/commands/keys)).
166
166
 
167
167
  (I should point out the truncation strategy will never truncate your schema_migrations table.)
168
168
 
169
- Some strategies need to be started before tests are run (for example the `:transaction` strategy needs to know to open up a transaction). This can be accomplished by calling `DatabaseCleaner.start` at the beginning of the run, or by running the tests inside a block to `Database.cleaning`. So you would have:
169
+ Some strategies need to be started before tests are run (for example the `:transaction` strategy needs to know to open up a transaction). This can be accomplished by calling `DatabaseCleaner.start` at the beginning of the run, or by running the tests inside a block to `DatabaseCleaner.cleaning`. So you would have:
170
170
 
171
171
  ```ruby
172
172
  require 'database_cleaner'
@@ -284,7 +284,7 @@ RSpec.configure do |config|
284
284
  MSG
285
285
  end
286
286
  DatabaseCleaner.clean_with(:truncation)
287
- end
287
+ end
288
288
 
289
289
  config.before(:each) do
290
290
  DatabaseCleaner.strategy = :transaction
@@ -295,7 +295,7 @@ RSpec.configure do |config|
295
295
  # with the specs, so continue to use transaction strategy for speed.
296
296
  driver_shares_db_connection_with_specs = Capybara.current_driver == :rack_test
297
297
 
298
- if !driver_shares_db_connection_with_specs
298
+ unless driver_shares_db_connection_with_specs
299
299
  # Driver is probably for an external browser with an app
300
300
  # under test that does *not* share a database connection with the
301
301
  # specs, so use truncation strategy.
@@ -363,7 +363,7 @@ This should cover the basics of tear down between scenarios and keeping your dat
363
363
 
364
364
  For more examples see the section ["Why?"](#why).
365
365
 
366
- ## How to use with multiple ORM's
366
+ ## How to use with multiple ORMs
367
367
 
368
368
  Sometimes you need to use multiple ORMs in your application.
369
369
 
@@ -482,7 +482,7 @@ For ActiveRecord, you add the following parameter in your database.yml file:
482
482
  test:
483
483
  adapter: postgresql
484
484
  # ...
485
- min_messages: WARNING
485
+ min_messages: WARNING
486
486
  </pre>
487
487
 
488
488
  ### Nothing happens in JRuby with Sequel using transactions
@@ -502,6 +502,29 @@ Dir["#{Rails.root}/app/models/**/*.rb"].each do |model|
502
502
  end
503
503
  ```
504
504
 
505
+ ## Safeguards
506
+
507
+ DatabaseCleaner comes with safeguards against:
508
+
509
+ * Running in production (checking for `ENV`, `RACK_ENV`, and `RAILS_ENV`)
510
+ * Running against a remote database (checking for a `DATABASE_URL` that does not include `localhost`)
511
+
512
+ Both safeguards can be disabled separately as follows.
513
+
514
+ Using environment variables:
515
+
516
+ ```
517
+ export DATABASE_CLEANER_ALLOW_PRODUCTION=true
518
+ export DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
519
+ ```
520
+
521
+ In Ruby:
522
+
523
+ ```ruby
524
+ DatabaseCleaner.allow_production = true
525
+ DatabaseCleaner.allow_remote_database_url = true
526
+ ```
527
+
505
528
  ## Debugging
506
529
 
507
530
  In rare cases DatabaseCleaner will encounter errors that it will log. By default it uses STDOUT set to the ERROR level but you can configure this to use whatever Logger you desire.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
- :minor: 5
4
- :patch: 2
3
+ :minor: 7
4
+ :patch: 0
@@ -57,6 +57,22 @@ module DatabaseCleaner
57
57
  end
58
58
  end
59
59
 
60
+ def self.migration_table_name
61
+ if ::ActiveRecord::VERSION::MAJOR < 5
62
+ ::ActiveRecord::Migrator.schema_migrations_table_name
63
+ else
64
+ ::ActiveRecord::SchemaMigration.table_name
65
+ end
66
+ end
67
+
68
+ def self.exclusion_condition(column_name)
69
+ result = " #{column_name} <> '#{::DatabaseCleaner::ActiveRecord::Base.migration_table_name}' "
70
+ if ::ActiveRecord::VERSION::MAJOR >= 5
71
+ result += " AND #{column_name} <> '#{::ActiveRecord::Base.internal_metadata_table_name}' "
72
+ end
73
+ result
74
+ end
75
+
60
76
  private
61
77
 
62
78
  def lookup_from_connection_pool
@@ -69,8 +85,8 @@ module DatabaseCleaner
69
85
 
70
86
  def establish_connection
71
87
  ::ActiveRecord::Base.establish_connection(connection_hash)
88
+ ::ActiveRecord::Base
72
89
  end
73
-
74
90
  end
75
91
  end
76
92
  end
@@ -54,8 +54,29 @@ module DatabaseCleaner::ActiveRecord
54
54
 
55
55
  def tables_with_new_rows(connection)
56
56
  @db_name ||= connection.instance_variable_get('@config')[:database]
57
- result = connection.exec_query("SELECT table_name FROM information_schema.tables WHERE table_schema = '#{@db_name}' AND table_rows > 0")
58
- result.map{ |row| row['table_name'] } - ['schema_migrations']
57
+ stats = table_stats_query(connection, @db_name)
58
+ if stats != ''
59
+ connection.exec_query(stats).inject([]) {|all, stat| all << stat['table_name'] if stat['exact_row_count'] > 0; all }
60
+ else
61
+ []
62
+ end
63
+ end
64
+
65
+ def table_stats_query(connection, db_name)
66
+ if @cache_tables && !@table_stats_query.nil?
67
+ return @table_stats_query
68
+ else
69
+ tables = connection.select_values(<<-SQL)
70
+ SELECT table_name
71
+ FROM information_schema.tables
72
+ WHERE table_schema = '#{db_name}'
73
+ AND #{::DatabaseCleaner::ActiveRecord::Base.exclusion_condition('table_name')};
74
+ SQL
75
+ queries = tables.map do |table|
76
+ "SELECT #{connection.quote(table)} AS table_name, COUNT(*) AS exact_row_count FROM #{connection.quote_table_name(table)}"
77
+ end
78
+ @table_stats_query = queries.join(' UNION ')
79
+ end
59
80
  end
60
81
 
61
82
  def information_schema_exists? connection
@@ -192,7 +192,7 @@ module DatabaseCleaner
192
192
  FROM pg_tables
193
193
  WHERE
194
194
  tablename !~ '_prt_' AND
195
- tablename <> '#{::ActiveRecord::Migrator.schema_migrations_table_name}' AND
195
+ #{::DatabaseCleaner::ActiveRecord::Base.exclusion_condition('tablename')} AND
196
196
  schemaname = ANY (current_schemas(false))
197
197
  _SQL
198
198
  rows.collect { |result| result.first }
@@ -257,7 +257,7 @@ module DatabaseCleaner::ActiveRecord
257
257
 
258
258
  # overwritten
259
259
  def migration_storage_names
260
- [::ActiveRecord::Migrator.schema_migrations_table_name]
260
+ [::DatabaseCleaner::ActiveRecord::Base.migration_table_name]
261
261
  end
262
262
 
263
263
  def cache_tables?
@@ -1,4 +1,5 @@
1
1
  require 'database_cleaner/null_strategy'
2
+ require 'database_cleaner/safeguard'
2
3
  module DatabaseCleaner
3
4
  class Base
4
5
  include Comparable
@@ -15,6 +16,7 @@ module DatabaseCleaner
15
16
  end
16
17
  self.db = opts[:connection] || opts[:model] if opts.has_key?(:connection) || opts.has_key?(:model)
17
18
  set_default_orm_strategy
19
+ Safeguard.new.run
18
20
  end
19
21
 
20
22
  def db=(desired_db)
@@ -28,7 +28,7 @@ module DatabaseCleaner
28
28
  private
29
29
 
30
30
  def session
31
- ::Mongoid.default_client
31
+ ::Mongoid::VERSION > "5.0.0" ? ::Mongoid.default_client : ::Mongoid.default_session
32
32
  end
33
33
 
34
34
  def database
@@ -11,5 +11,10 @@ module DatabaseCleaner
11
11
  def self.clean
12
12
  # no-op
13
13
  end
14
+
15
+ def self.cleaning(&block)
16
+ # no-op
17
+ yield
18
+ end
14
19
  end
15
20
  end
@@ -25,7 +25,7 @@ module DatabaseCleaner
25
25
  @connection ||= begin
26
26
  if url == :default
27
27
  ::Redis.new
28
- elsif db.class.is_a?(::Redis) # pass directly the connection
28
+ elsif db.is_a?(::Redis) # pass directly the connection
29
29
  db
30
30
  else
31
31
  ::Redis.new(:url => url)
@@ -0,0 +1,72 @@
1
+ module DatabaseCleaner
2
+ class Safeguard
3
+ class Error < Exception
4
+ class RemoteDatabaseUrl < Error
5
+ def initialize
6
+ super("ENV['DATABASE_URL'] is set to a remote URL. Please refer to https://github.com/DatabaseCleaner/database_cleaner#safeguards")
7
+ end
8
+ end
9
+
10
+ class ProductionEnv < Error
11
+ def initialize(env)
12
+ super("ENV['#{env}'] is set to production. Please refer to https://github.com/DatabaseCleaner/database_cleaner#safeguards")
13
+ end
14
+ end
15
+ end
16
+
17
+ class RemoteDatabaseUrl
18
+ LOCAL = %w(localhost 127.0.0.1)
19
+
20
+ def run
21
+ raise Error::RemoteDatabaseUrl if !skip? && given?
22
+ end
23
+
24
+ private
25
+
26
+ def given?
27
+ remote?(ENV['DATABASE_URL'])
28
+ end
29
+
30
+ def remote?(url)
31
+ url && !LOCAL.any? { |str| url.include?(str) }
32
+ end
33
+
34
+ def skip?
35
+ ENV['DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL'] ||
36
+ DatabaseCleaner.allow_remote_database_url
37
+ end
38
+ end
39
+
40
+ class Production
41
+ KEYS = %w(ENV RACK_ENV RAILS_ENV)
42
+
43
+ def run
44
+ raise Error::ProductionEnv.new(key) if !skip? && given?
45
+ end
46
+
47
+ private
48
+
49
+ def given?
50
+ !!key
51
+ end
52
+
53
+ def key
54
+ @key ||= KEYS.detect { |key| ENV[key] == 'production' }
55
+ end
56
+
57
+ def skip?
58
+ ENV['DATABASE_CLEANER_ALLOW_PRODUCTION'] ||
59
+ DatabaseCleaner.allow_production
60
+ end
61
+ end
62
+
63
+ CHECKS = [
64
+ RemoteDatabaseUrl,
65
+ Production
66
+ ]
67
+
68
+ def run
69
+ CHECKS.each { |const| const.new.run }
70
+ end
71
+ end
72
+ end
@@ -2,7 +2,11 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.i
2
2
  require 'database_cleaner/configuration'
3
3
 
4
4
  module DatabaseCleaner
5
- def self.can_detect_orm?
6
- DatabaseCleaner::Base.autodetect_orm
5
+ class << self
6
+ attr_accessor :allow_remote_database_url, :allow_production
7
+
8
+ def can_detect_orm?
9
+ DatabaseCleaner::Base.autodetect_orm
10
+ end
7
11
  end
8
12
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_cleaner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Mabey
8
+ - Ernesto Tagwerker
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-04-18 00:00:00.000000000 Z
12
+ date: 2018-04-19 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rake
@@ -376,7 +377,7 @@ dependencies:
376
377
  version: '0'
377
378
  description: Strategies for cleaning databases. Can be used to ensure a clean state
378
379
  for testing.
379
- email: ben@benmabey.com
380
+ email: ernesto@ombulabs.com
380
381
  executables: []
381
382
  extensions: []
382
383
  extra_rdoc_files:
@@ -393,46 +394,6 @@ files:
393
394
  - TODO
394
395
  - VERSION.yml
395
396
  - cucumber.yml
396
- - examples/Gemfile
397
- - examples/Gemfile.lock
398
- - examples/config/database.yml
399
- - examples/config/database.yml.example
400
- - examples/config/redis.yml
401
- - examples/db/activerecord_one.db
402
- - examples/db/activerecord_two.db
403
- - examples/db/datamapper_default.db
404
- - examples/db/datamapper_one.db
405
- - examples/db/datamapper_two.db
406
- - examples/db/sqlite_databases_go_here
407
- - examples/features/example.feature
408
- - examples/features/example_multiple_db.feature
409
- - examples/features/example_multiple_orm.feature
410
- - examples/features/step_definitions/activerecord_steps.rb
411
- - examples/features/step_definitions/couchpotato_steps.rb
412
- - examples/features/step_definitions/datamapper_steps.rb
413
- - examples/features/step_definitions/mongoid_steps.rb
414
- - examples/features/step_definitions/mongomapper_steps.rb
415
- - examples/features/step_definitions/neo4j_steps.rb
416
- - examples/features/step_definitions/translation_steps.rb
417
- - examples/features/support/env.rb
418
- - examples/lib/activerecord_models.rb
419
- - examples/lib/couchpotato_models.rb
420
- - examples/lib/datamapper_models.rb
421
- - examples/lib/mongoid_models.rb
422
- - examples/lib/mongomapper_models.rb
423
- - examples/lib/neo4j_models.rb
424
- - examples/lib/ohm_models.rb
425
- - examples/lib/redis_models.rb
426
- - examples/lib/sequel_models.rb
427
- - features/cleaning.feature
428
- - features/cleaning_default_strategy.feature
429
- - features/cleaning_multiple_dbs.feature
430
- - features/cleaning_multiple_orms.feature
431
- - features/step_definitions/database_cleaner_steps.rb
432
- - features/step_definitions/ohm_steps.rb
433
- - features/step_definitions/redis_steps.rb
434
- - features/support/env.rb
435
- - features/support/feature_runner.rb
436
397
  - lib/database_cleaner.rb
437
398
  - lib/database_cleaner/active_record/base.rb
438
399
  - lib/database_cleaner/active_record/deletion.rb
@@ -469,57 +430,11 @@ files:
469
430
  - lib/database_cleaner/ohm/truncation.rb
470
431
  - lib/database_cleaner/redis/base.rb
471
432
  - lib/database_cleaner/redis/truncation.rb
433
+ - lib/database_cleaner/safeguard.rb
472
434
  - lib/database_cleaner/sequel/base.rb
473
435
  - lib/database_cleaner/sequel/deletion.rb
474
436
  - lib/database_cleaner/sequel/transaction.rb
475
437
  - lib/database_cleaner/sequel/truncation.rb
476
- - spec/database_cleaner/active_record/base_spec.rb
477
- - spec/database_cleaner/active_record/transaction_spec.rb
478
- - spec/database_cleaner/active_record/truncation/mysql2_spec.rb
479
- - spec/database_cleaner/active_record/truncation/mysql_spec.rb
480
- - spec/database_cleaner/active_record/truncation/postgresql_spec.rb
481
- - spec/database_cleaner/active_record/truncation/shared_fast_truncation.rb
482
- - spec/database_cleaner/active_record/truncation/sqlite3_spec.rb
483
- - spec/database_cleaner/active_record/truncation_spec.rb
484
- - spec/database_cleaner/base_spec.rb
485
- - spec/database_cleaner/configuration_spec.rb
486
- - spec/database_cleaner/couch_potato/truncation_spec.rb
487
- - spec/database_cleaner/data_mapper/base_spec.rb
488
- - spec/database_cleaner/data_mapper/transaction_spec.rb
489
- - spec/database_cleaner/data_mapper/truncation/sqlite3_spec.rb
490
- - spec/database_cleaner/data_mapper/truncation_spec.rb
491
- - spec/database_cleaner/generic/base_spec.rb
492
- - spec/database_cleaner/generic/truncation_spec.rb
493
- - spec/database_cleaner/mongo/mongo_examples.rb
494
- - spec/database_cleaner/mongo/truncation_spec.rb
495
- - spec/database_cleaner/mongo_mapper/base_spec.rb
496
- - spec/database_cleaner/mongo_mapper/mongo_examples.rb
497
- - spec/database_cleaner/mongo_mapper/truncation_spec.rb
498
- - spec/database_cleaner/moped/moped_examples.rb
499
- - spec/database_cleaner/moped/truncation_spec.rb
500
- - spec/database_cleaner/neo4j/base_spec.rb
501
- - spec/database_cleaner/neo4j/transaction_spec.rb
502
- - spec/database_cleaner/ohm/truncation_spec.rb
503
- - spec/database_cleaner/redis/base_spec.rb
504
- - spec/database_cleaner/redis/truncation_spec.rb
505
- - spec/database_cleaner/sequel/base_spec.rb
506
- - spec/database_cleaner/sequel/deletion_spec.rb
507
- - spec/database_cleaner/sequel/transaction_spec.rb
508
- - spec/database_cleaner/sequel/truncation/sqlite3_spec.rb
509
- - spec/database_cleaner/sequel/truncation_spec.rb
510
- - spec/database_cleaner/shared_strategy.rb
511
- - spec/rcov.opts
512
- - spec/spec_helper.rb
513
- - spec/support/active_record/database_setup.rb
514
- - spec/support/active_record/migrations/20150101010000_create_users.rb
515
- - spec/support/active_record/migrations/20150101020000_create_agents.rb
516
- - spec/support/active_record/mysql2_setup.rb
517
- - spec/support/active_record/mysql_setup.rb
518
- - spec/support/active_record/postgresql_setup.rb
519
- - spec/support/active_record/schema_setup.rb
520
- - spec/support/active_record/sqlite3_setup.rb
521
- - spec/support/data_mapper/schema_setup.rb
522
- - spec/support/data_mapper/sqlite3_setup.rb
523
438
  homepage: http://github.com/DatabaseCleaner/database_cleaner
524
439
  licenses:
525
440
  - MIT
@@ -540,7 +455,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
540
455
  version: '0'
541
456
  requirements: []
542
457
  rubyforge_project:
543
- rubygems_version: 2.4.5.1
458
+ rubygems_version: 2.7.3
544
459
  signing_key:
545
460
  specification_version: 4
546
461
  summary: Strategies for cleaning databases. Can be used to ensure a clean state for
data/examples/Gemfile DELETED
@@ -1 +0,0 @@
1
- gemspec