diff options
author | Jan Pieper <kontakt@jan-pieper.info> | 2017-07-12 19:00:49 +0200 |
---|---|---|
committer | Jan Pieper <kontakt@jan-pieper.info> | 2017-07-12 19:00:49 +0200 |
commit | 8dca921987d9cfcbe6e29f3b164fb7bf08cde3ff (patch) | |
tree | a3e0c53589ae1b381629cfd3aba78b25d8ff1dfd /activerecord/test | |
parent | 58f10a31b37e9bb6e975a71aa63744f318ee043d (diff) | |
download | rails-8dca921987d9cfcbe6e29f3b164fb7bf08cde3ff.tar.gz rails-8dca921987d9cfcbe6e29f3b164fb7bf08cde3ff.tar.bz2 rails-8dca921987d9cfcbe6e29f3b164fb7bf08cde3ff.zip |
Sort enabled adapter extensions in schema dump
The list of enabled adapter extensions in the schema dump isn't
sorted by default, so it may happen that the sorting changes
over time. If you're using a VCS, a change to the sorting results
in a diff without any real change. Sorting the list should solve
this problem.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index 4c81e825fa..9e57417e9c 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -301,6 +301,20 @@ class SchemaDumperTest < ActiveRecord::TestCase assert_no_match "# These are extensions that must be enabled", output assert_no_match %r{enable_extension}, output end + + def test_schema_dump_includes_extensions_in_alphabetic_order + connection = ActiveRecord::Base.connection + + connection.stubs(:extensions).returns(["hstore", "uuid-ossp", "xml2"]) + output = perform_schema_dump + enabled_extensions = output.scan(%r{enable_extension "(.+)"}).flatten + assert_equal ["hstore", "uuid-ossp", "xml2"], enabled_extensions + + connection.stubs(:extensions).returns(["uuid-ossp", "xml2", "hstore"]) + output = perform_schema_dump + enabled_extensions = output.scan(%r{enable_extension "(.+)"}).flatten + assert_equal ["hstore", "uuid-ossp", "xml2"], enabled_extensions + end end end |