waterpig 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/waterpig/database-cleaner.rb +20 -4
  3. metadata +13 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f2d3287a8c660f5c387fec3faa77aac784eb25b
4
- data.tar.gz: 1943bb35f6eabfbc5c26387dd2ca3dcb58cf25fe
3
+ metadata.gz: b349b7ddbf6e8b2bebf907efb200cf9057b7b3f3
4
+ data.tar.gz: 8b2607476872f954ca0534e24410ce86e87c941b
5
5
  SHA512:
6
- metadata.gz: d0a935eceeb133ac31298cdae3a70887bbe3b48e84d1b4613966bce00a3d7b6eeb7cc730d6e6c7a01862db3698abd0bd22c4c2a61b7135d701011ca586bc37f1
7
- data.tar.gz: 4a6fbe79a423eed639bb969165b0619ba4982db1aebff4e7bd547c9f54493b99d35317b1fd77031e6c0b3669fdf894331ccd7cead3856f25c936c88e6cd08884
6
+ metadata.gz: 236c7fa170196b4a70df0f71cac6747bb92e9537efb2d6f8fd29d81bf6975983afebc80d214fc46f868d7e41bbc2daede5fb258ac8088047efe23853fe510d0f
7
+ data.tar.gz: c0e54fb386ed33c2aacff72f930c4539ac1923f89e4855e5685836a221a887e572f9b6763cead3c6cfa1576b8c3de5935d1acc92e93b4dfe7099528c8bfa528a
@@ -4,7 +4,9 @@ RSpec.configure do |config|
4
4
  #config.use_transactional_fixtures = false
5
5
  DatabaseCleaner.strategy = :transaction
6
6
 
7
+ config.add_setting :waterpig_exclude_cleaning_key, :default => :manual_database_cleaning
7
8
  config.add_setting :waterpig_truncation_types, :default => [:feature]
9
+ config.add_setting :waterpig_skip_cleaning_types, :default => []
8
10
  config.add_setting :waterpig_exclude_seeds_types, :default => []
9
11
  config.add_setting :waterpig_database_truncation_config, :default => {:except => %w[spatial_ref_sys]}
10
12
  config.add_setting :waterpig_db_seeds, :default => 'db/seeds.rb'
@@ -23,7 +25,21 @@ RSpec.configure do |config|
23
25
  end
24
26
  end
25
27
 
26
- config.before :all, :type => proc{ |value| config.waterpig_truncation_types.include?(value)} do
28
+ def use_truncate?(config, metadata)
29
+ return false if metadata[config.waterpig_exclude_cleaning_key]
30
+ return false if config.waterpig_skip_cleaning_types.include?(metadata[:type])
31
+ return false unless config.waterpig_truncation_types.include?(metadata[:type])
32
+ return true
33
+ end
34
+
35
+ def use_transaction?(config, metadata)
36
+ return false if metadata[config.waterpig_exclude_cleaning_key]
37
+ return false if use_truncate?(config, metadata)
38
+ return false if config.waterpig_skip_cleaning_types.include?(metadata[:type])
39
+ return true
40
+ end
41
+
42
+ config.before :all, :description => proc{ |value, metadata| use_truncate?(config, metadata) } do
27
43
  with_showing(true, false) do
28
44
  DatabaseCleaner.clean_with :truncation, config.waterpig_database_truncation_config
29
45
  unless config.waterpig_exclude_seeds_types.include?(self.class.metadata[:type])
@@ -34,7 +50,7 @@ RSpec.configure do |config|
34
50
  end
35
51
  end
36
52
 
37
- config.after :all, :type => proc{ |value| config.waterpig_truncation_types.include?(value)} do
53
+ config.after :all, :description => proc{ |value, metadata| use_truncate?(config, metadata) } do
38
54
  with_showing(true, true) do
39
55
  Rails.application.config.action_dispatch.show_detailed_exceptions = true
40
56
  DatabaseCleaner.clean_with :truncation, config.waterpig_database_truncation_config
@@ -44,11 +60,11 @@ RSpec.configure do |config|
44
60
  end
45
61
  end
46
62
 
47
- config.before :each, :type => proc{ |value| !config.waterpig_truncation_types.include?(value) } do
63
+ config.before :each, :description => proc{ |value, metadata| use_transaction?(config, metadata) } do
48
64
  DatabaseCleaner.start
49
65
  end
50
66
 
51
- config.after :each, :type => proc{ |value| !config.waterpig_truncation_types.include?(value) } do
67
+ config.after :each, :description => proc{ |value, metadata| use_transaction?(config, metadata) } do
52
68
  DatabaseCleaner.clean
53
69
  end
54
70
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waterpig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Judson Lester
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-17 00:00:00.000000000 Z
12
+ date: 2015-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capybara
@@ -77,22 +77,22 @@ extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
79
  - lib/waterpig.rb
80
- - lib/waterpig/browser-console-logger.rb
81
- - lib/waterpig/browser-integration.rb
82
- - lib/waterpig/browser-size.rb
83
- - lib/waterpig/browser-tools.rb
80
+ - lib/waterpig/save-and-open-on-fail.rb
84
81
  - lib/waterpig/ckeditor-tools.rb
82
+ - lib/waterpig/selenium_chrome.rb
85
83
  - lib/waterpig/database-cleaner.rb
86
84
  - lib/waterpig/deadbeat-connections.rb
87
- - lib/waterpig/poltergeist.rb
88
- - lib/waterpig/save-and-open-on-fail.rb
89
- - lib/waterpig/selenium_chrome.rb
90
- - lib/waterpig/snap-step.rb
91
85
  - lib/waterpig/tinymce-tools.rb
86
+ - lib/waterpig/browser-integration.rb
87
+ - lib/waterpig/browser-console-logger.rb
88
+ - lib/waterpig/poltergeist.rb
92
89
  - lib/waterpig/warning-suppressor.rb
90
+ - lib/waterpig/snap-step.rb
91
+ - lib/waterpig/browser-tools.rb
92
+ - lib/waterpig/browser-size.rb
93
93
  - spec/embarrassing.rb
94
- - spec_help/gem_test_suite.rb
95
94
  - spec_help/spec_helper.rb
95
+ - spec_help/gem_test_suite.rb
96
96
  homepage: http://nyarly.github.com/waterpig
97
97
  licenses:
98
98
  - MIT
@@ -103,7 +103,7 @@ rdoc_options:
103
103
  - --main
104
104
  - doc/README
105
105
  - --title
106
- - waterpig-0.6.1 Documentation
106
+ - waterpig-0.7.0 Documentation
107
107
  require_paths:
108
108
  - lib/
109
109
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project: waterpig
121
- rubygems_version: 2.4.3
121
+ rubygems_version: 2.0.14
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Capybara helper stuff