aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/commands/dbconsole_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix rails db command with sqlite3 databaseCarlos Antonio da Silva2012-11-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | When using sqlite3 it was attempting to find the database file based on Rails.root, the problem is that Rails.root is not always present because we try to first manually load "config/database.yml" instead of loading the entire app, to make "rails db" faster. This means that when we're in the root path of the app, calling "rails db" won't allow us to use Rails.root, making the command fail for sqlite3 with the error: ./rails/commands/dbconsole.rb:62:in `start': undefined method `root' for Rails:Module (NoMethodError) The fix is to simply not pass any dir string to File.expand_path, which will make it use the current directory of the process as base, or the root path of the app, which is what we want. When we are in any other subdirectory, calling "rails db" should work just fine, because "config/database.yml" won't be found, thus "rails db" will fallback to loading the app, making Rails.root available. Closes #8257.
* Set RACK_ENV to nil in the dbconsole testRafael Mendonça França2012-05-301-0/+1
| | | | This will fix the travis-ci build
* Fix various bugs with console arguments.Sam Oliver2012-05-301-10/+11
| | | | Allow hyphens in environment names again.
* More assert_match warnings fixed.Arun Agrawal2012-05-301-4/+4
|
* Fix `rails db -h` and cosmetic fixes in usage bannersAlexey Vakhov2012-05-221-0/+18
| | | | | | | Ruby tries to use '-h' as short version of '--header' by default https://github.com/ruby/ruby/blob/trunk/lib/optparse.rb#L1372-1381. To force `rails db -h` prints an usage message we should add the `-h` options explicitly.
* Use relative path to sqlite3 db in `rails db` commandAlexey Vakhov2012-05-221-6/+11
| | | | | | | | | | Rails uses sqlit3 db file with a path relative to the rails root. It allows to execute server not from rails root only. For example you can fire `./spec/dummy/script/rails s` to start dummy application server if you develop some engine gem. Now the `rails db` command uses relative paths also and you can explore your dummy db via `./spec/dummy/script/rails db` command.
* Fix buildPiotr Sarnacki2012-05-061-7/+10
|
* More faster rails dbconsoleDmitry Vorotilin2012-05-061-28/+57
|
* Add Rails::DBConsole testsAlexey Vakhov2012-05-021-0/+128