Skip to content

Commit

Permalink
Use default argument in test
Browse files Browse the repository at this point in the history
We should use a default argument so that when there is only one option
we can delete the arguments instead of updating all the callers.
  • Loading branch information
eileencodes committed Sep 1, 2020
1 parent 854587c commit e4af759
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions railties/test/application/rake/multi_dbs_test.rb
Expand Up @@ -85,7 +85,7 @@ def db_migrate_and_schema_cache_dump_and_schema_cache_clear
end
end

def db_migrate_and_schema_dump_and_load(schema_format)
def db_migrate_and_schema_dump_and_load(schema_format = "ruby")
add_to_config "config.active_record.schema_format = :#{schema_format}"
require "#{app_path}/config/environment"

Expand Down Expand Up @@ -428,7 +428,7 @@ def generate_models_for_animals
end

test "db:migrate and db:schema:dump and db:schema:load works on all databases" do
db_migrate_and_schema_dump_and_load "ruby"
db_migrate_and_schema_dump_and_load
end

test "db:migrate and db:schema:dump and db:schema:load works on all databases with sql option" do
Expand Down Expand Up @@ -692,7 +692,7 @@ class TwoMigration < ActiveRecord::Migration::Current
ENV.delete "RAILS_ENV"
ENV.delete "RACK_ENV"

db_migrate_and_schema_dump_and_load "ruby"
db_migrate_and_schema_dump_and_load

app_file "db/seeds.rb", <<-RUBY
print Book.connection.pool.db_config.database
Expand Down

0 comments on commit e4af759

Please sign in to comment.