Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

resolver tests fail if mysql adapter not installed #6616

Merged
merged 1 commit into from

2 participants

@dpassage

The resolver tests fail if the mysql gem is not installed; this breaks
being able to run the sqlite3 tests without that gem.

To reproduce:

bundle install --without db
cd active record
bundle exec rake test_sqlite3

This fix ensures the tests will only run if the mysql gem is installed.

A better solution might be to move these tests into the per-adapter tests,
and test each adapter's resolver.

David Paschich The resolver tests fail if the mysql gem is not installed; this breaks
being able to run the sqlite3 tests without that gem. This fix ensures
the tests will only run if the mysql gem is installed.

A better solution might be to move these tests into the per-adapter tests,
and test each adapter's resolver.
a36bda8
@dpassage

I thought of that. I didn't because it's not quite the right condition; the test can pass if mysql is installed and not the current adapter. The tests you mention above only apply if mysql is the current adapter because they interact directly with the database.

But I can change it if that's the right thing to do.

@carlosantoniodasilva

Fair enough, I'm gonna merge, thanks.

@carlosantoniodasilva carlosantoniodasilva merged commit 8359a2f into rails:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 4, 2012
  1. The resolver tests fail if the mysql gem is not installed; this breaks

    David Paschich authored
    being able to run the sqlite3 tests without that gem. This fix ensures
    the tests will only run if the mysql gem is installed.
    
    A better solution might be to move these tests into the per-adapter tests,
    and test each adapter's resolver.
This page is out of date. Refresh to see the latest.
View
3  activerecord/test/cases/connection_specification/resolver_test.rb
@@ -9,6 +9,7 @@ def resolve(spec)
end
def test_url_host_no_db
+ skip "only if mysql is available" unless defined?(MysqlAdapter)
spec = resolve 'mysql://foo?encoding=utf8'
assert_equal({
:adapter => "mysql",
@@ -18,6 +19,7 @@ def test_url_host_no_db
end
def test_url_host_db
+ skip "only if mysql is available" unless defined?(MysqlAdapter)
spec = resolve 'mysql://foo/bar?encoding=utf8'
assert_equal({
:adapter => "mysql",
@@ -27,6 +29,7 @@ def test_url_host_db
end
def test_url_port
+ skip "only if mysql is available" unless defined?(MysqlAdapter)
spec = resolve 'mysql://foo:123?encoding=utf8'
assert_equal({
:adapter => "mysql",
Something went wrong with that request. Please try again.