mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Show rails instead of bin/rails on USAGE instructions
With this commit, rails commands usage instructions display now +rails+ instead of +bin/rails+ within their recommendations.
This commit is contained in:
parent
49e6df3529
commit
a7986aeda0
6 changed files with 11 additions and 11 deletions
|
@ -70,7 +70,7 @@ module Rails
|
|||
end
|
||||
|
||||
def executable
|
||||
"bin/rails #{command_name}"
|
||||
"rails #{command_name}"
|
||||
end
|
||||
|
||||
# Use Rails' default banner.
|
||||
|
|
|
@ -5,7 +5,7 @@ require "minitest"
|
|||
|
||||
module Rails
|
||||
class TestUnitReporter < Minitest::StatisticsReporter
|
||||
class_attribute :executable, default: "bin/rails test"
|
||||
class_attribute :executable, default: "rails test"
|
||||
|
||||
def record(result)
|
||||
super
|
||||
|
|
|
@ -504,7 +504,7 @@ module ApplicationTests
|
|||
create_test_file :models, "post", pass: false, print: false
|
||||
|
||||
output = run_test_command("test/models/post_test.rb")
|
||||
expect = %r{Running:\n\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/models/post_test.rb:6\]:\nwups!\n\nbin/rails test test/models/post_test.rb:4\n\n\n\n}
|
||||
expect = %r{Running:\n\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/models/post_test.rb:6\]:\nwups!\n\nrails test test/models/post_test.rb:4\n\n\n\n}
|
||||
assert_match expect, output
|
||||
end
|
||||
|
||||
|
|
|
@ -265,14 +265,14 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase
|
|||
stdout = capture(:stdout) do
|
||||
Rails::Command.invoke(:dbconsole, ["-h"])
|
||||
end
|
||||
assert_match(/bin\/rails dbconsole \[environment\]/, stdout)
|
||||
assert_match(/rails dbconsole \[environment\]/, stdout)
|
||||
end
|
||||
|
||||
def test_print_help_long
|
||||
stdout = capture(:stdout) do
|
||||
Rails::Command.invoke(:dbconsole, ["--help"])
|
||||
end
|
||||
assert_match(/bin\/rails dbconsole \[environment\]/, stdout)
|
||||
assert_match(/rails dbconsole \[environment\]/, stdout)
|
||||
end
|
||||
|
||||
attr_reader :aborted, :output
|
||||
|
|
|
@ -19,7 +19,7 @@ class TestRunnerInEngineTest < ActiveSupport::TestCase
|
|||
create_test_file "post", pass: false
|
||||
|
||||
output = run_test_command("test/post_test.rb")
|
||||
expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/post_test\.rb:6\]:\nwups!\n\nbin/rails test test/post_test\.rb:4}
|
||||
expect = %r{Running:\n\nPostTest\nF\n\nFailure:\nPostTest#test_truth \[[^\]]+test/post_test\.rb:6\]:\nwups!\n\nrails test test/post_test\.rb:4}
|
||||
assert_match expect, output
|
||||
end
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
|
|||
@reporter.record(failed_test)
|
||||
@reporter.report
|
||||
|
||||
assert_match %r{^bin/rails test .*test/test_unit/reporter_test\.rb:\d+$}, @output.string
|
||||
assert_match %r{^rails test .*test/test_unit/reporter_test\.rb:\d+$}, @output.string
|
||||
assert_rerun_snippet_count 1
|
||||
end
|
||||
|
||||
|
@ -64,7 +64,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
|
|||
@reporter.record(failed_test)
|
||||
@reporter.report
|
||||
|
||||
expect = %r{\AF\n\nFailure:\nTestUnitReporterTest::ExampleTest#woot \[[^\]]+\]:\nboo\n\nbin/rails test test/test_unit/reporter_test\.rb:\d+\n\n\z}
|
||||
expect = %r{\AF\n\nFailure:\nTestUnitReporterTest::ExampleTest#woot \[[^\]]+\]:\nboo\n\nrails test test/test_unit/reporter_test\.rb:\d+\n\n\z}
|
||||
assert_match expect, @output.string
|
||||
end
|
||||
|
||||
|
@ -72,7 +72,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
|
|||
@reporter.record(errored_test)
|
||||
@reporter.report
|
||||
|
||||
expect = %r{\AE\n\nError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n \n\nbin/rails test .*test/test_unit/reporter_test\.rb:\d+\n\n\z}
|
||||
expect = %r{\AE\n\nError:\nTestUnitReporterTest::ExampleTest#woot:\nArgumentError: wups\n \n\nrails test .*test/test_unit/reporter_test\.rb:\d+\n\n\z}
|
||||
assert_match expect, @output.string
|
||||
end
|
||||
|
||||
|
@ -81,7 +81,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
|
|||
verbose.record(skipped_test)
|
||||
verbose.report
|
||||
|
||||
expect = %r{\ATestUnitReporterTest::ExampleTest#woot = 10\.00 s = S\n\n\nSkipped:\nTestUnitReporterTest::ExampleTest#woot \[[^\]]+\]:\nskipchurches, misstemples\n\nbin/rails test test/test_unit/reporter_test\.rb:\d+\n\n\z}
|
||||
expect = %r{\ATestUnitReporterTest::ExampleTest#woot = 10\.00 s = S\n\n\nSkipped:\nTestUnitReporterTest::ExampleTest#woot \[[^\]]+\]:\nskipchurches, misstemples\n\nrails test test/test_unit/reporter_test\.rb:\d+\n\n\z}
|
||||
assert_match expect, @output.string
|
||||
end
|
||||
|
||||
|
@ -159,7 +159,7 @@ class TestUnitReporterTest < ActiveSupport::TestCase
|
|||
|
||||
private
|
||||
def assert_rerun_snippet_count(snippet_count)
|
||||
assert_equal snippet_count, @output.string.scan(%r{^bin/rails test }).size
|
||||
assert_equal snippet_count, @output.string.scan(%r{^rails test }).size
|
||||
end
|
||||
|
||||
def failed_test
|
||||
|
|
Loading…
Reference in a new issue