diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-12-07 15:16:18 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-12-10 16:08:37 +0900 |
commit | e4e42d0b346065f1fce6caaea669c3e4bc42dfc8 (patch) | |
tree | 66e99342a40795b2e5fd9a94b56ab44f549f2789 /railties/test/generators/plugin_test_runner_test.rb | |
parent | 11fbcf84ac29d6040be1b0988d22054342ed74d4 (diff) | |
download | rails-e4e42d0b346065f1fce6caaea669c3e4bc42dfc8.tar.gz rails-e4e42d0b346065f1fce6caaea669c3e4bc42dfc8.tar.bz2 rails-e4e42d0b346065f1fce6caaea669c3e4bc42dfc8.zip |
show relative path the rerun snippet of test runner in rails engine
Since the absolute path is not required to re-run the test,
modified so that unnecessary information is not displayed.
```ruby
# before
bin/rails test /path/to/blorgh/test/integration/navigation_test.rb:5
# after
bin/rails test test/integration/navigation_test.rb:5
```
Diffstat (limited to 'railties/test/generators/plugin_test_runner_test.rb')
-rw-r--r-- | railties/test/generators/plugin_test_runner_test.rb | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/railties/test/generators/plugin_test_runner_test.rb b/railties/test/generators/plugin_test_runner_test.rb index 0444e13865..716728819e 100644 --- a/railties/test/generators/plugin_test_runner_test.rb +++ b/railties/test/generators/plugin_test_runner_test.rb @@ -1,7 +1,8 @@ -require 'tmpdir' -require 'abstract_unit' +require 'generators/plugin_test_helper' class PluginTestRunnerTest < ActiveSupport::TestCase + include PluginTestHelper + def setup @destination_root = Dir.mktmpdir('bukkits') Dir.chdir(@destination_root) { `bundle exec rails plugin new bukkits --skip-bundle` } @@ -100,24 +101,4 @@ class PluginTestRunnerTest < ActiveSupport::TestCase def run_test_command(arguments) Dir.chdir(plugin_path) { `bin/test #{arguments}` } end - - def create_test_file(name, pass: true) - plugin_file "test/#{name}_test.rb", <<-RUBY - require 'test_helper' - - class #{name.camelize}Test < ActiveSupport::TestCase - def test_truth - puts "#{name.camelize}Test" - assert #{pass}, 'wups!' - end - end - RUBY - end - - def plugin_file(path, contents, mode: 'w') - FileUtils.mkdir_p File.dirname("#{plugin_path}/#{path}") - File.open("#{plugin_path}/#{path}", mode) do |f| - f.puts contents - end - end end |