diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-11 14:08:12 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-11 14:08:12 -0800 |
commit | c5034d60dba0cd31a6a8c612ee35d63b8127793a (patch) | |
tree | ccf318ce3d403c1fc5453f492dc1afae3ebc3dd1 /railties/test | |
parent | e00ab2dab9671603dcc8ab571baf1b1df100f99b (diff) | |
download | rails-c5034d60dba0cd31a6a8c612ee35d63b8127793a.tar.gz rails-c5034d60dba0cd31a6a8c612ee35d63b8127793a.tar.bz2 rails-c5034d60dba0cd31a6a8c612ee35d63b8127793a.zip |
add a send so `apply` can be called. Fixes #13510
THIS IS A HUGE HACK. Thor does not allow us to define public methods
without turning them in to "thor tasks". That means we cannot subclass
the `apply` method and make it public, so we have to make the method
private and call `send` on it.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/rake/templates_test.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/railties/test/application/rake/templates_test.rb b/railties/test/application/rake/templates_test.rb new file mode 100644 index 0000000000..1fca80debd --- /dev/null +++ b/railties/test/application/rake/templates_test.rb @@ -0,0 +1,32 @@ +require "isolation/abstract_unit" + +module ApplicationTests + module RakeTests + class TemplatesTest < ActiveSupport::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + require "rails/all" + super + end + + def teardown + super + teardown_app + end + + def test_rake_template + Dir.chdir(app_path) do + cmd = "bundle exec rake rails:template LOCATION=foo" + r,w = IO.pipe + Process.waitpid Process.spawn(cmd, out: w, err: w) + w.close + assert_match(/Could not find.*foo/, r.read) + r.close + end + end + end + end +end + |