Skip to content

Commit

Permalink
fix invalid syntax and sqlite rake failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Rodriguez committed Jun 18, 2012
1 parent a6cda54 commit 7fd7747
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions activerecord/lib/active_record/tasks/sqlite_database_tasks.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def drop


FileUtils.rm(file) if File.exist?(file) FileUtils.rm(file) if File.exist?(file)
end end

alias :purge :drop alias :purge :drop


private private
Expand All @@ -37,4 +36,6 @@ def configuration
def root def root
@root @root
end end
end end
end
end
2 changes: 1 addition & 1 deletion activerecord/test/cases/mysql_rake_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ def test_recreates_database_with_the_given_options
) )
end end
end end
end end
2 changes: 1 addition & 1 deletion activerecord/test/cases/postgresql_rake_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ def test_establishes_connection
ActiveRecord::Tasks::DatabaseTasks.purge @configuration ActiveRecord::Tasks::DatabaseTasks.purge @configuration
end end
end end
end end
6 changes: 4 additions & 2 deletions activerecord/test/cases/sqlite_rake_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module ActiveRecord module ActiveRecord
class SqliteDBCreateTest < ActiveRecord::TestCase class SqliteDBCreateTest < ActiveRecord::TestCase
def setup def setup
@database = "db_create.sqlite3" @database = 'db_create.sqlite3'
@connection = stub :connection @connection = stub :connection
@configuration = { @configuration = {
'adapter' => 'sqlite3', 'adapter' => 'sqlite3',
Expand Down Expand Up @@ -77,6 +77,7 @@ def test_creates_path_from_database
end end


def test_removes_file_with_absolute_path def test_removes_file_with_absolute_path
File.stubs(:exist?).returns(true)
@path.stubs(:absolute?).returns(true) @path.stubs(:absolute?).returns(true)


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


def test_removes_file_with_relative_path def test_removes_file_with_relative_path
File.stubs(:exist?).returns(true)
@path.stubs(:absolute?).returns(false) @path.stubs(:absolute?).returns(false)


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


ActiveRecord::Tasks::DatabaseTasks.drop @configuration, '/rails/root' ActiveRecord::Tasks::DatabaseTasks.drop @configuration, '/rails/root'
end end
end end
end end

0 comments on commit 7fd7747

Please sign in to comment.