diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-02-06 23:01:39 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-02-06 23:03:48 -0200 |
commit | 1b75666f7f4ec7f013182d24b919ca27b0ca0068 (patch) | |
tree | a308484f521c4bbd7c5ca403eec658ba745860f1 | |
parent | 86f4db97aa70eb4dedd2967b02a7557801fb8232 (diff) | |
download | rails-1b75666f7f4ec7f013182d24b919ca27b0ca0068.tar.gz rails-1b75666f7f4ec7f013182d24b919ca27b0ca0068.tar.bz2 rails-1b75666f7f4ec7f013182d24b919ca27b0ca0068.zip |
Run schema dumper extensions without creating real extensions
There is no need to create the extension in the database just to test if
it's dumped, we can stub that instead.
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index bbe1a14d00..50a8f79ad9 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -1,6 +1,5 @@ require "cases/helper" - class SchemaDumperTest < ActiveRecord::TestCase def setup super @@ -233,19 +232,13 @@ class SchemaDumperTest < ActiveRecord::TestCase if current_adapter?(:PostgreSQLAdapter) def test_schema_dump_includes_extensions connection = ActiveRecord::Base.connection - return skip unless connection.supports_extensions? - unless connection.extension_enabled?('hstore') - connection.enable_extension 'hstore' - end + connection.stubs(:extensions).returns(['hstore']) output = standard_dump assert_match "# These are extensions that must be enabled", output assert_match %r{enable_extension "hstore"}, output - connection.extensions.each do |ext| - connection.disable_extension ext - end - + connection.stubs(:extensions).returns([]) output = standard_dump assert_no_match "# These are extensions that must be enabled", output assert_no_match %r{enable_extension}, output |