database_cleaner 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,5 +1,9 @@
1
1
  == 0.6.x (in git)
2
2
 
3
+ === Bugfixes
4
+ * Don't modify the array passed in with the :except key. (Eric Wollesen)
5
+ * Fixes version checking for postgresql. (Greg Barnett)
6
+
3
7
  == 0.6.5 2011-03-08
4
8
 
5
9
  === Bugfixes
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 5
2
+ :patch: 6
3
3
  :major: 0
4
4
  :build:
5
5
  :minor: 6
@@ -60,18 +60,15 @@ module ActiveRecord
60
60
  class PostgreSQLAdapter < AbstractAdapter
61
61
 
62
62
  def db_version
63
- @db_version ||= select_values(
64
- "SELECT CHARACTER_VALUE
65
- FROM INFORMATION_SCHEMA.SQL_IMPLEMENTATION_INFO
66
- WHERE IMPLEMENTATION_INFO_NAME = 'DBMS VERSION' ").join.to_s
63
+ @db_version ||= postgresql_version
67
64
  end
68
65
 
69
66
  def cascade
70
- @cascade ||= db_version >= "08.02" ? "CASCADE" : ""
67
+ @cascade ||= db_version >= 80200 ? 'CASCADE' : ''
71
68
  end
72
69
 
73
70
  def restart_identity
74
- @restart_identity ||= db_version >= "08.04" ? "RESTART IDENTITY" : ""
71
+ @restart_identity ||= db_version >= 80400 ? 'RESTART IDENTITY' : ''
75
72
  end
76
73
 
77
74
  def truncate_table(table_name)
@@ -15,7 +15,7 @@ module DatabaseCleaner
15
15
  end
16
16
 
17
17
  @only = opts[:only]
18
- @tables_to_exclude = (opts[:except] || [])
18
+ @tables_to_exclude = (opts[:except] || []).dup
19
19
  @tables_to_exclude << migration_storage_name unless migration_storage_name.nil?
20
20
  end
21
21
 
@@ -62,6 +62,16 @@ module ::DatabaseCleaner
62
62
  its(:only) { should == nil }
63
63
  its(:except) { should == ["migration_storage_name"] }
64
64
  end
65
+
66
+ context "" do
67
+ EXCEPT_TABLES = ["something"]
68
+ subject { MigrationExample.new( { :except => EXCEPT_TABLES } ) }
69
+
70
+ it "should not modify the array of excepted tables" do
71
+ subject.except.should include("migration_storage_name")
72
+ EXCEPT_TABLES.should_not include("migration_storage_name")
73
+ end
74
+ end
65
75
  end
66
76
  end
67
77
  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: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 5
10
- version: 0.6.5
9
+ - 6
10
+ version: 0.6.6
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-03-08 00:00:00 -07:00
18
+ date: 2011-03-16 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies: []
21
21