Ticket #11433: add_script_console_for_rails_contributors.diff
| File add_script_console_for_rails_contributors.diff, 1.8 kB (added by thechrisoshow, 6 months ago) |
|---|
-
activerecord/RUNNING_UNIT_TESTS
old new 29 29 30 30 That'll run the base suite using the MySQL-Ruby adapter. 31 31 32 == Console 32 33 34 There is also a script/console that allows you to examine the Rails test data just like you would a normal rails application. Use it with: 33 35 36 script/console 37 38 If you want to try it with different database connector pass the adapter name as a parameter. For example: 39 40 script/console sqlite3 41 -
activerecord/script/console
old new 1 #!/usr/bin/env ruby 2 irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb' 3 4 options = { :irb => irb } 5 libs = " -r irb/completion" 6 libs << %( -r "script/console") 7 8 ENV['ADAPTER'] = ARGV.first || 'mysql' 9 10 puts "Loading #{ENV['ADAPTER']} environment" 11 12 exec "#{options[:irb]} #{libs} --simple-prompt" -
activerecord/script/console.rb
old new 1 $:.unshift(File.dirname(__FILE__) + '/../test') 2 $:.unshift(File.dirname(__FILE__) + "/../test/connections/native_#{ENV['ADAPTER']}") 3 4 require 'cases/helper' 5 6 # work around the at_exit hook in test/unit, which kills IRB 7 Test::Unit.run = true if Test::Unit.respond_to?(:run=) 8 9 Dir.glob("test/models/*.rb").each {|f| require f} 10