mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Merge pull request #1813 from arunagw/jruby_tests
Tests Added for jdbc option added for Jruby
This commit is contained in:
@@ -134,7 +134,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
||||
|
||||
def test_config_jdbcmysql_database
|
||||
run_generator([destination_root, "-d", "jdbcmysql"])
|
||||
assert_file "config/database.yml", /jdbcmysql/
|
||||
assert_file "config/database.yml", /mysql/
|
||||
assert_file "Gemfile", /^gem\s+["']activerecord-jdbcmysql-adapter["']$/
|
||||
# TODO: When the JRuby guys merge jruby-openssl in
|
||||
# jruby this will be removed
|
||||
@@ -143,16 +143,31 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
||||
|
||||
def test_config_jdbcsqlite3_database
|
||||
run_generator([destination_root, "-d", "jdbcsqlite3"])
|
||||
assert_file "config/database.yml", /jdbcsqlite3/
|
||||
assert_file "config/database.yml", /sqlite3/
|
||||
assert_file "Gemfile", /^gem\s+["']activerecord-jdbcsqlite3-adapter["']$/
|
||||
end
|
||||
|
||||
def test_config_jdbcpostgresql_database
|
||||
run_generator([destination_root, "-d", "jdbcpostgresql"])
|
||||
assert_file "config/database.yml", /jdbcpostgresql/
|
||||
assert_file "config/database.yml", /postgresql/
|
||||
assert_file "Gemfile", /^gem\s+["']activerecord-jdbcpostgresql-adapter["']$/
|
||||
end
|
||||
|
||||
def test_config_jdbc_database
|
||||
run_generator([destination_root, "-d", "jdbc"])
|
||||
assert_file "config/database.yml", /jdbc/
|
||||
assert_file "config/database.yml", /mssql/
|
||||
assert_file "Gemfile", /^gem\s+["']activerecord-jdbc-adapter["']$/
|
||||
end
|
||||
|
||||
def test_config_jdbc_database_when_no_option_given
|
||||
if defined?(JRUBY_VERSION)
|
||||
run_generator([destination_root])
|
||||
assert_file "config/database.yml", /sqlite3/
|
||||
assert_file "Gemfile", /^gem\s+["']activerecord-jdbcsqlite3-adapter["']$/
|
||||
end
|
||||
end
|
||||
|
||||
def test_generator_if_skip_active_record_is_given
|
||||
run_generator [destination_root, "--skip-active-record"]
|
||||
assert_no_file "config/database.yml"
|
||||
|
||||
Reference in New Issue
Block a user