database_cleaner 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,11 @@
1
- == 0.6.2 (in git)
1
+ == 0.6.x (in git)
2
+
3
+ == 0.6.3 2011-02-09
4
+
5
+ === New Features
6
+ * Configurable logger to aid in debugging database cleaner. (Marty Haught)
7
+
8
+ == 0.6.2 2011-02-04
2
9
 
3
10
  === New Features
4
11
  * Support IBM_DB Adapter for table truncation. This is for DB2 >= 9.7 (GH-39 Samer Abukhait)
data/README.textile CHANGED
@@ -93,6 +93,13 @@ end
93
93
 
94
94
  For use in Cucumber please see the section below.
95
95
 
96
+ 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. Here's an example of using the Rails.logger in env.rb:
97
+
98
+ <pre>
99
+ DatabaseCleaner.logger = Rails.logger
100
+ </pre>
101
+
102
+
96
103
  h2. How to use with multiple ORM's
97
104
 
98
105
  Sometimes you need to use multiple ORMs in your application. You can use DatabaseCleaner to clean multiple ORMs, and multiple connections for those ORMs.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :minor: 6
3
- :build:
4
- :patch: 2
2
+ :patch: 3
5
3
  :major: 0
4
+ :build:
5
+ :minor: 6
@@ -25,6 +25,18 @@ module DatabaseCleaner
25
25
  def connections
26
26
  @connections ||= [::DatabaseCleaner::Base.new]
27
27
  end
28
+
29
+ def logger=(log_source)
30
+ @logger = log_source
31
+ end
32
+
33
+ def logger
34
+ return @logger if @logger
35
+
36
+ @logger = Logger.new(STDOUT)
37
+ @logger.level = Logger::ERROR
38
+ @logger
39
+ end
28
40
 
29
41
  def strategy=(stratagem)
30
42
  self.connections.each { |connect| connect.strategy = stratagem }
@@ -3,5 +3,9 @@ Before do
3
3
  end
4
4
 
5
5
  After do
6
- DatabaseCleaner.clean
6
+ begin
7
+ DatabaseCleaner.clean
8
+ rescue Exception => e
9
+ DatabaseCleaner.logger.error "Exception encountered by DatabaseCleaner in Cucumber After block: #{e}"
10
+ end
7
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_cleaner
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 2
10
- version: 0.6.2
9
+ - 3
10
+ version: 0.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ben Mabey
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-04 00:00:00 -07:00
18
+ date: 2011-02-09 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies: []
21
21