adaptable_tests_for_rails 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- require 'adaptable_tests_for_rails/railtie'
1
+ require 'adaptable_tests_for_rails/railtie' if /3\.\d+\.\d+/.match( Rails.version )
2
2
 
3
3
  module AdaptableTestsForRails
4
4
  end
@@ -6,15 +6,12 @@ module AdaptableTestsForRails
6
6
  setup_test_environment( ENV['DB'] || 'test' )
7
7
  end
8
8
 
9
- config.before_initialize do
10
-
11
- end
12
-
13
9
  def setup_test_environment( env )
14
- puts "", "Connecting to #{db_type( env )} database ..."
15
10
  ActiveRecord::Base.establish_connection( Rails.configuration.database_configuration["test_#{env}"] )
16
11
  puts building_database_statement, ""
17
- load schema_path
12
+ silence_stream STDOUT do
13
+ load schema_path
14
+ end
18
15
  end
19
16
 
20
17
  def db_type( env )
@@ -1,3 +1,3 @@
1
1
  module AdaptableTestsForRails
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -0,0 +1,22 @@
1
+ def setup_test_environment( env )
2
+ puts "", "Connecting to #{db_type( env )} database ..."
3
+ ActiveRecord::Base.establish_connection( Rails.configuration.database_configuration["test_#{env}"] )
4
+ puts building_database_statement, ""
5
+ load schema_path
6
+ end
7
+
8
+ def db_type( env )
9
+ env.gsub( /test_/, '' ).gsub( /_/, ' ' )
10
+ end
11
+
12
+ def building_database_statement
13
+ "Building database from db/schema.rb ..."
14
+ end
15
+
16
+ def schema_path
17
+ "#{Rails.root}/db/schema.rb"
18
+ end
19
+
20
+ if Rails.env.test?
21
+ setup_test_environment( ENV['DB'] || 'test' )
22
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adaptable_tests_for_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
+ - 1
8
9
  - 0
9
- - 0
10
- version: 1.0.0
10
+ version: 1.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - C. Jason Harrelson (midas)
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-02 00:00:00 -05:00
18
+ date: 2011-09-17 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -40,6 +40,7 @@ files:
40
40
  - lib/adaptable_tests_for_rails.rb
41
41
  - lib/adaptable_tests_for_rails/railtie.rb
42
42
  - lib/adaptable_tests_for_rails/version.rb
43
+ - rails/init.rb
43
44
  has_rdoc: true
44
45
  homepage: ""
45
46
  licenses: []