isolator 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e990fc085af8e46328e3738fbb03045ea0ab4ed5d8d8d03541bb3cfd3fbea30
4
- data.tar.gz: 70c6db99fcd940ce42d7d7dd1d0147f5f1773de6fdc8cbdb6a60300131107373
3
+ metadata.gz: 3330be0a90b276b54420aa7a44a79417cacb5c55edb2fc59bc1f6fa85774d5d3
4
+ data.tar.gz: d97281da4ea2e8f8cfb92703035b76e1e47969477fb1f462c9f382183439ce7d
5
5
  SHA512:
6
- metadata.gz: a79e5e0ce491e8cdc54c474d2f239d597d0a9fbec3fcfa8028b9625eab4d8c7b1300d51c6cc3e3c17e09a0f1ab439052af868633b68c861defb2862684ba6bb4
7
- data.tar.gz: cd5d43b4e991e00deae27b6db429416c12cb4fb6dae68353a9c4b19f5698d907354ee142f2b395d72f659db93c20ccbfd58f6880cad601591141725011e365ed
6
+ metadata.gz: 7e74da7cd7c11f149b3e2d80f1b23ea6ee605de8219d9ae54576019bb42ef010f53f185e648dae4fe1fc007e7f38d3dd2ad19b1fdf6542266ff2f03f50cc6cdd
7
+ data.tar.gz: 91ab7e065521a8a0ebb001528fbf31e6df2008089b0e9f544a4c2c128278f321f652bde932d0e3c46eb79f8121289de763946f012946f57eba72ba6a027b1616
@@ -1,5 +1,11 @@
1
1
  # Change log
2
2
 
3
+ ## master
4
+
5
+ ## 0.3.0 (2018-04-02)
6
+
7
+ - Add support for the [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) gem. ([@Envek][])
8
+
3
9
  ## 0.2.2 (2018-03-28)
4
10
 
5
11
  - [Fix [#14](https://github.com/palkan/isolator/issues/14)] Always use default value for threshold. ([@palkan][])
@@ -35,3 +41,4 @@
35
41
  [@alexshgov]: https://github.com/alexshgov
36
42
  [@TheSmartnik]: https://github.com/TheSmartnik
37
43
  [@dsalahutdinov]: https://github.com/dsalahutdinov
44
+ [@Envek]: https://github.com/Envek
data/README.md CHANGED
@@ -98,6 +98,11 @@ Isolator relys on [uniform_notifier][] to send custom notifications.
98
98
 
99
99
  **NOTE:** `uniform_notifier` should be installed separately (i.e., added to Gemfile).
100
100
 
101
+ ### Transactional tests support
102
+
103
+ - Rails' baked-in [use_transactional_tests](api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html#class-ActiveRecord::FixtureSet-label-Transactional+Tests)
104
+ - [database_cleaner](https://github.com/DatabaseCleaner/database_cleaner) gem. Make sure that you require isolator _after_ database_cleaner.
105
+
101
106
  ### Supported ORMs
102
107
 
103
108
  - `ActiveRecord` >= 4.1
@@ -38,4 +38,5 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency "fakeredis"
39
39
  spec.add_development_dependency "resque-scheduler"
40
40
  spec.add_development_dependency "sucker_punch"
41
+ spec.add_development_dependency "database_cleaner"
41
42
  end
@@ -112,3 +112,4 @@ require "isolator/orm_adapters"
112
112
 
113
113
  require "isolator/adapters"
114
114
  require "isolator/railtie" if defined?(Rails)
115
+ require "isolator/database_cleaner_support" if defined?(DatabaseCleaner)
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "database_cleaner/active_record/transaction"
4
+
5
+ ::DatabaseCleaner::ActiveRecord::Transaction.prepend(
6
+ Module.new do
7
+ def start
8
+ super
9
+ Isolator.transactions_threshold += 1
10
+ end
11
+
12
+ def clean
13
+ Isolator.transactions_threshold -= 1
14
+ super
15
+ end
16
+ end
17
+ )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Isolator
4
- VERSION = "0.2.2"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isolator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Dementyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-28 00:00:00.000000000 Z
11
+ date: 2018-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sniffer
@@ -234,6 +234,20 @@ dependencies:
234
234
  - - ">="
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: database_cleaner
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
237
251
  description: Detect non-atomic interactions within DB transactions
238
252
  email:
239
253
  - dementiev.vm@gmail.com
@@ -273,6 +287,7 @@ files:
273
287
  - lib/isolator/adapters/mailers/mail.rb
274
288
  - lib/isolator/callbacks.rb
275
289
  - lib/isolator/configuration.rb
290
+ - lib/isolator/database_cleaner_support.rb
276
291
  - lib/isolator/errors.rb
277
292
  - lib/isolator/ext/thread_fetch.rb
278
293
  - lib/isolator/isolate.rb