Skip to content

Commit ab551be

Browse files
committed
Merge pull request rails#6767 from frodsan/fix_sqlite_rake_tests
fix invalid syntax and sqlite rake failing tests
2 parents a6cda54 + 7fd7747 commit ab551be

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

activerecord/lib/active_record/tasks/sqlite_database_tasks.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def drop
2525

2626
FileUtils.rm(file) if File.exist?(file)
2727
end
28-
2928
alias :purge :drop
3029

3130
private
@@ -37,4 +36,6 @@ def configuration
3736
def root
3837
@root
3938
end
40-
end
39+
end
40+
end
41+
end

activerecord/test/cases/mysql_rake_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,4 @@ def test_recreates_database_with_the_given_options
176176
)
177177
end
178178
end
179-
end
179+
end

activerecord/test/cases/postgresql_rake_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ def test_establishes_connection
132132
ActiveRecord::Tasks::DatabaseTasks.purge @configuration
133133
end
134134
end
135-
end
135+
end

activerecord/test/cases/sqlite_rake_test.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
module ActiveRecord
55
class SqliteDBCreateTest < ActiveRecord::TestCase
66
def setup
7-
@database = "db_create.sqlite3"
7+
@database = 'db_create.sqlite3'
88
@connection = stub :connection
99
@configuration = {
1010
'adapter' => 'sqlite3',
@@ -77,6 +77,7 @@ def test_creates_path_from_database
7777
end
7878

7979
def test_removes_file_with_absolute_path
80+
File.stubs(:exist?).returns(true)
8081
@path.stubs(:absolute?).returns(true)
8182

8283
FileUtils.expects(:rm).with('/absolute/path')
@@ -94,11 +95,12 @@ def test_generates_absolute_path_with_given_root
9495
end
9596

9697
def test_removes_file_with_relative_path
98+
File.stubs(:exist?).returns(true)
9799
@path.stubs(:absolute?).returns(false)
98100

99101
FileUtils.expects(:rm).with('/former/relative/path')
100102

101103
ActiveRecord::Tasks::DatabaseTasks.drop @configuration, '/rails/root'
102104
end
103105
end
104-
end
106+
end

0 commit comments

Comments
 (0)