Commit Graph

37 Commits

Author SHA1 Message Date
Daniel Colson
0d50cae996 Use respond_to test helpers 2018-01-25 23:32:58 -05:00
Pat Allan
acea68de02 Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
yuuji.yaginuma
af4cef024b Extract assert_output and available_pty? into ConsoleHelpers module
We define almost the same method with multiple tests. Therefore, it extract
into module.
2017-07-25 15:01:33 +09:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
yuuji.yaginuma
c776b64708 Allow irb options to be passed from rails console command
Fixes #28988
2017-05-08 10:07:17 +09:00
Michael Grosser
a9aed2ac94
improve error message when include assertions fail
assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message

assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
2016-09-16 12:03:37 -07:00
Xavier Noria
783763bde9 applies new string literal convention in railties/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:16:09 +02:00
Prathamesh Sonpatki
d93427840e
Remove unused boot_rails method and it's usage
- The `boot_rails` method from abstract_unit.rb is empty after 2abcdfd978fdcd491576a237e8c6b.
- So let's remove it and its usage.
2016-07-04 09:34:21 +05:30
Matthew Draper
d3c9d808e3 Publish AS::Executor and AS::Reloader APIs
These should allow external code to run blocks of user code to do
"work", at a similar unit size to a web request, without needing to get
intimate with ActionDipatch.
2016-03-02 02:14:20 +10:30
yuuji.yaginuma
4fded7c069 modify console of app method in that can use the path helpers 2015-06-05 18:38:53 +09:00
Vipul A M
c0be6c9811 cleanup railties test; fix typos 2013-03-31 20:50:21 +05:30
Jon Leighton
c91789c76b Don't kill the console
Use the "quit" command instead. This seems to prevents some weirdness on
OS X. See #9761.
2013-03-22 14:43:49 +00:00
Jon Leighton
7748d64a76 Send SIGTERM, not SIGQUIT.
SIGTERM is the correct signal for a graceful exit.

This will hopefully resolve #9761.
2013-03-22 12:04:29 +00:00
Jon Leighton
9ae81be072 Fix race condition in test
This should fix travis. For real this time! This is the one!

The readpartial(100) meant that an earlier assert_stdout could chomp up
the output that a later assert_stdout wants, meaning that the later
assertion fails.

Reading only 1 byte at a time ensure that we don't read any more than is
necessary to verify the assertion.
2013-03-09 20:32:01 +00:00
Jon Leighton
72be5bb557 Bump up timeouts
This should fix travis.

Also ensuring that we don't try to kill when pid is nil.
2013-03-09 17:52:32 +00:00
Jon Leighton
e5fc096bea The console --sandbox transaction should not be joinable
Thanks @neerajdotname for noticing this bug.
2013-03-08 15:10:46 +00:00
Jon Leighton
be3e10cd26 Fix rails console --sandbox
I've also added a proper acceptance test which reproduced the issue.

Closes #9513, #9515.
2013-03-08 13:58:56 +00:00
Rafael Mendonça França
ccecab3ba9 Remove observers and sweepers
They was extracted from a plugin.

See https://github.com/rails/rails-observers

[Rafael Mendonça França + Steve Klabnik]
2012-11-28 22:46:49 -02:00
Aaron Patterson
8f309e3105 convert railties to use AS::TestCase 2012-01-05 17:30:17 -08:00
José Valim
283a087634 Clean up the cache before the request in case we are running in the reload_classes_only_on_change schema. 2011-12-15 18:48:10 +01:00
José Valim
fa1d9a884c Speed up development by only reloading classes if dependencies files changed.
This can be turned off by setting `config.reload_classes_only_on_change` to false.

Extensions like Active Record should add their respective files like db/schema.rb and db/structure.sql to `config.watchable_files` if they want their changes to affect classes reloading.

Thanks to https://github.com/paneq/active_reload and Pastorino for the inspiration. <3
2011-12-12 22:54:04 +01:00
Arun Agrawal
76b6027cd8 Unused variable removed 2011-11-15 13:23:27 +05:30
Akira Matsuda
6d09f275c6 Modulize Rails console methods so that other console libraries such as Pry can include these methods 2011-11-09 15:42:19 +09:00
Akira Matsuda
7102a3d7fc move Rails console top level methods to IRB context 2011-11-04 05:31:47 +09:00
Jon Leighton
62570e8626 Solve the RAILS_ENV problem in the railties tests in a more generic way 2011-06-06 13:54:05 +01:00
Arun Agrawal
5d78d81222 Fix for CI server. Dependent on RAILS_ENV=development 2011-06-06 16:13:22 +05:30
José Valim
52e01fc59d Everyone receives app as argument for consistency. 2011-05-25 01:37:55 +02:00
José Valim
92661b0c50 Move sandbox to AR and pass the sandbox as a value. This way, other ORMs like Datamapper can also have their own sandboxing in rails console. 2011-05-04 16:47:35 +02:00
José Valim
0cbfd6c28d Small changes on AD::Reloader. 2010-12-20 12:43:02 +01:00
John Firebaugh
435bccda93 Replace AD::Callbacks.to_prepare with AD::Reloader.to_prepare
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-20 12:43:02 +01:00
José Valim
d649bf158b Provide a cleaner syntax for paths configuration that does not rely on method_missing. 2010-10-06 17:20:15 +02:00
Carlos Antonio da Silva
7fc1edd790 Remove deprecated stuff in ActionController
This removes all deprecated classes in ActionController related to
Routing, Abstract Request/Response and Integration/IntegrationTest.
All tests and docs were changed to ActionDispatch instead of ActionController.
2010-09-26 02:13:45 +08:00
José Valim
fa98eca75b Add console hook to force ActiveRecord::Base to be loaded when console starts avoiding reference loops. 2010-07-18 11:02:07 +02:00
José Valim
e6dffb70e6 reload! on console now works as expected. [#3822 status:resolved] 2010-02-26 12:09:39 +01:00
José Valim
d3c40242a5 Move console stuff to its own directory. 2010-01-23 23:02:43 +01:00
Joshua Peek
635aa91224 More robust console test 2009-10-05 09:41:08 -05:00