Methods
- S
- T
Instance Public methods
setup()
Link
# File activerecord/test/cases/tasks/sqlite_rake_test.rb, line 75 def setup @database = "db_create.sqlite3" @path = stub(:to_s => '/absolute/path', :absolute? => true) @configuration = { 'adapter' => 'sqlite3', 'database' => @database } Pathname.stubs(:new).returns(@path) File.stubs(:join).returns('/former/relative/path') FileUtils.stubs(:rm).returns(true) $stdout, @original_stdout = StringIO.new, $stdout $stderr, @original_stderr = StringIO.new, $stderr end
teardown()
Link
test_creates_path_from_database()
Link
test_generates_absolute_path_with_given_root()
Link
# File activerecord/test/cases/tasks/sqlite_rake_test.rb, line 110 def test_generates_absolute_path_with_given_root @path.stubs(:absolute?).returns(false) File.expects(:join).with('/rails/root', @path). returns('/former/relative/path') ActiveRecord::Tasks::DatabaseTasks.drop @configuration, '/rails/root' end
test_removes_file_with_absolute_path()
Link
# File activerecord/test/cases/tasks/sqlite_rake_test.rb, line 101 def test_removes_file_with_absolute_path File.stubs(:exist?).returns(true) @path.stubs(:absolute?).returns(true) FileUtils.expects(:rm).with('/absolute/path') ActiveRecord::Tasks::DatabaseTasks.drop @configuration, '/rails/root' end
test_removes_file_with_relative_path()
Link
# File activerecord/test/cases/tasks/sqlite_rake_test.rb, line 119 def test_removes_file_with_relative_path File.stubs(:exist?).returns(true) @path.stubs(:absolute?).returns(false) FileUtils.expects(:rm).with('/former/relative/path') ActiveRecord::Tasks::DatabaseTasks.drop @configuration, '/rails/root' end
test_when_db_dropped_successfully_outputs_info_to_stdout()
Link