diff options
author | Eileen M. Uchitelle <eileencodes@gmail.com> | 2015-02-28 11:34:14 -0500 |
---|---|---|
committer | Eileen M. Uchitelle <eileencodes@gmail.com> | 2015-02-28 11:34:14 -0500 |
commit | 58aecb0f7e3ffd6a4e85b928b9aa38438599a254 (patch) | |
tree | e1c606c89037ae05367d440ae958ece0130210ee /railties/test/application/rake | |
parent | c93f808ea5b872c3eaf3ade1fb67218e9eda1318 (diff) | |
parent | b181297ad7f60c6006292ab024ed08a490bdb4f8 (diff) | |
download | rails-58aecb0f7e3ffd6a4e85b928b9aa38438599a254.tar.gz rails-58aecb0f7e3ffd6a4e85b928b9aa38438599a254.tar.bz2 rails-58aecb0f7e3ffd6a4e85b928b9aa38438599a254.zip |
Merge pull request #18965 from hjoo/rake_restart
created rake restart task
Diffstat (limited to 'railties/test/application/rake')
-rw-r--r-- | railties/test/application/rake/restart_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/railties/test/application/rake/restart_test.rb b/railties/test/application/rake/restart_test.rb new file mode 100644 index 0000000000..35099913fb --- /dev/null +++ b/railties/test/application/rake/restart_test.rb @@ -0,0 +1,31 @@ +require "isolation/abstract_unit" + +module ApplicationTests + module RakeTests + class RakeRestartTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + boot_rails + end + + def teardown + teardown_app + end + + test 'rake restart touches tmp/restart.txt' do + Dir.chdir(app_path) do + `rake restart` + assert File.exist?("tmp/restart.txt") + + prev_mtime = File.mtime("tmp/restart.txt") + sleep(1) + `rake restart` + curr_mtime = File.mtime("tmp/restart.txt") + assert_not_equal prev_mtime, curr_mtime + end + end + end + end +end |