Skip to content

Commit

Permalink
Fix stubbed methods in test cases
Browse files Browse the repository at this point in the history
Remove returning of `false` value for stubbed `lock_thread=` methods
since there aren't any needs in it.

Remove unnecessary returning of `true` for stubbed `drop_database` method.
Follow up #33309.

Related to #33162, #33326.
  • Loading branch information
bogdanvlviv committed Jul 10, 2018
1 parent 23f80ce commit d2d7296
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions activerecord/test/cases/fixtures_test.rb
Expand Up @@ -842,7 +842,7 @@ def rollback_transaction(*args); end
end.new

connection.pool = Class.new do
def lock_thread=(lock_thread); false; end
def lock_thread=(lock_thread); end
end.new

connection.expects(:begin_transaction).with(joinable: false)
Expand All @@ -863,7 +863,7 @@ def rollback_transaction(*args)
end.new

connection.pool = Class.new do
def lock_thread=(lock_thread); false; end
def lock_thread=(lock_thread); end
end.new

fire_connection_notification(connection)
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/cases/tasks/mysql_rake_test.rb
Expand Up @@ -104,7 +104,7 @@ def test_raises_error

class MySQLDBDropTest < ActiveRecord::TestCase
def setup
@connection = Class.new { def drop_database(name); true end }.new
@connection = Class.new { def drop_database(name); end }.new
@configuration = {
"adapter" => "mysql2",
"database" => "my-app-db"
Expand Down

0 comments on commit d2d7296

Please sign in to comment.