Created
July 22, 2015 20:38
-
-
Save nateberkopec/0c263d70835e86081e87 to your computer and use it in GitHub Desktop.
Patch to make tests pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/activerecord/test/cases/tasks/postgresql_rake_test.rb b/activerecord/test/cases/tasks/postgresql_rake_test.rb | |
index 3187338..3dac83f 100644 | |
--- a/activerecord/test/cases/tasks/postgresql_rake_test.rb | |
+++ b/activerecord/test/cases/tasks/postgresql_rake_test.rb | |
@@ -212,7 +212,7 @@ module ActiveRecord | |
def test_structure_dump_with_schema_search_path | |
@configuration['schema_search_path'] = 'foo,bar' | |
- Kernel.expects(:system).with("pg_dump -i -s -x -O -f #{@filename} --schema=foo --schema=bar my-app-db").returns(true) | |
+ Kernel.expects(:system).with("pg_dump", '-i', '-s', '-x', '-O', '-f', @filename, '--schema=foo --schema=bar', "my-app-db").returns(true) | |
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) | |
end | |
@@ -228,7 +228,7 @@ module ActiveRecord | |
end | |
def test_structure_dump_with_dump_schemas_string | |
- Kernel.expects(:system).with("pg_dump", '-i', '-s', '-x', '-O', '-f', @filename, '--schema=foo', '--schema=bar', "my-app-db").returns(true) | |
+ Kernel.expects(:system).with("pg_dump", '-i', '-s', '-x', '-O', '-f', @filename, '--schema=foo --schema=bar', "my-app-db").returns(true) | |
with_dump_schemas('foo,bar') do | |
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename) | |
@@ -261,14 +261,14 @@ module ActiveRecord | |
def test_structure_load | |
filename = "awesome-file.sql" | |
- Kernel.expects(:system).with("psql -X -q -f #{filename} my-app-db") | |
+ Kernel.expects(:system).with('psql', '-q', '-f', filename, @configuration['database']).returns(true) | |
ActiveRecord::Tasks::DatabaseTasks.structure_load(@configuration, filename) | |
end | |
def test_structure_load_accepts_path_with_spaces | |
filename = "awesome file.sql" | |
- Kernel.expects(:system).with("psql -X -q -f awesome\\ file.sql my-app-db") | |
+ Kernel.expects(:system).with('psql', '-q', '-f', filename, @configuration['database']).returns(true) | |
ActiveRecord::Tasks::DatabaseTasks.structure_load(@configuration, filename) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment