diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/README.md | 2 | ||||
-rwxr-xr-x | tools/console | 2 | ||||
-rwxr-xr-x | tools/profile | 2 | ||||
-rw-r--r-- | tools/test.rb | 18 |
4 files changed, 18 insertions, 6 deletions
diff --git a/tools/README.md b/tools/README.md index b2e7e4b0ae..f133b27128 100644 --- a/tools/README.md +++ b/tools/README.md @@ -6,3 +6,5 @@ They aren't used by Rails apps directly. * `console` drops you in irb and loads local Rails repos * `profile` profiles `Kernel#require` to help reduce startup time * `line_statistics` provides CodeTools module and LineStatistics class to count lines + * `test` is loaded by every major component of Rails to simplify testing, for example: + `cd ./actioncable; bin/test ./path/to/actioncable_test_with_line_number.rb:5` diff --git a/tools/console b/tools/console index 58c76fb1b6..ee08e22502 100755 --- a/tools/console +++ b/tools/console @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + require "bundler" Bundler.setup diff --git a/tools/profile b/tools/profile index 01e513c67a..6fb571f43b 100755 --- a/tools/profile +++ b/tools/profile @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + # Profile require calls giving information about the time and the files that are called # when loading the provided file. # diff --git a/tools/test.rb b/tools/test.rb index 71349a5974..1fd3ee30eb 100644 --- a/tools/test.rb +++ b/tools/test.rb @@ -1,20 +1,26 @@ +# frozen_string_literal: true + $: << File.expand_path("test", COMPONENT_ROOT) require "bundler" Bundler.setup -require "rails/test_unit/minitest_plugin" +require "rails/test_unit/runner" +require "rails/test_unit/reporter" require "rails/test_unit/line_filtering" +require "active_support" require "active_support/test_case" -module Rails - # Necessary to get rerun-snippts working. - def self.root +class << Rails + # Necessary to get rerun-snippets working. + def root @root ||= Pathname.new(COMPONENT_ROOT) end + alias __root root end ActiveSupport::TestCase.extend Rails::LineFiltering Rails::TestUnitReporter.executable = "bin/test" -Minitest.run_via = :rails -require "active_support/testing/autorun" + +Rails::TestUnit::Runner.parse_options(ARGV) +Rails::TestUnit::Runner.run(ARGV) |