rails/railties/test/commands/application_test.rb
Jonathan Hefner 078a1d630e Split up railties/test/command/application_test.rb
Follow-up to #47208.

Prior to #47208, `Rails::Command::ApplicationTest` appears to have been
specifically intended to test `Rails::Command::ApplicationCommand`.
Therefore, this commit extracts the tests that were added by #47208 out
from `railties/test/command/application_test.rb` into
`railties/test/command/help_integration_test.rb`, and moves
`application_test.rb` from `railties/test/command` to
`railties/test/commands` (with the rest of the command-specific tests).
2023-03-28 15:26:34 -05:00

23 lines
749 B
Ruby

# frozen_string_literal: true
require "abstract_unit"
require "rails/command"
class Rails::Command::ApplicationTest < ActiveSupport::TestCase
test "rails new without path prints help" do
output = run_application_command "new"
# Doesn't include the default thor error message:
assert_not output.start_with?("No value provided for required arguments")
# Includes contents of ~/railties/lib/rails/generators/rails/app/USAGE:
assert output.include?("The `rails new` command creates a new Rails application with a default
directory structure and configuration at the path you specify.")
end
private
def run_application_command(*args)
capture(:stdout) { Rails::Command.invoke(:application, args) }
end
end