Class: Rails::Command::TestCommand
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Base ,
Thor
|
|
Instance Chain:
|
|
Inherits: |
Rails::Command::Base
|
Defined in: | railties/lib/rails/commands/test/test_command.rb |
Constant Summary
-
EXACT_TEST_ARGUMENT_PATTERN =
# File 'railties/lib/rails/commands/test/test_command.rb', line 72/^-n|^--name\b|#{Rails::TestUnit::Runner::PATH_ARGUMENT_PATTERN}/
Class Attribute Summary
Base
- Inherited
.bin, .bin?, | |
.engine? | Returns true when the app is a Rails engine. |
.exit_on_failure? |
Class Method Summary
Base
- Inherited
.banner, | |
.base_name | Sets the base_name taking into account the current class namespace. |
.command_name | Return command name without namespaces. |
.default_command_root | Default file root to place extra files a command might need, placed one folder above the command file. |
.desc | Tries to get the description from a USAGE file one folder above the command root. |
.executable, | |
.hide_command! | Convenience method to hide this command from the available ones when running rails command. |
.namespace | Convenience method to get the namespace from the class name. |
.printing_commands, | |
.usage_path | Path to lookup a USAGE description in a file. |
.create_command | Allow the command method to be called perform. |
.namespaced_name, .resolve_path, .class_usage, | |
.help | Override Thor’s class-level help to also show the USAGE. |
.inherited, .perform |
Instance Method Summary
- #all(*args)
- #functionals(*args)
- #generators(*args)
- #perform(*args)
- #system(*args)
- #units(*args)
- #run_prepare_task private
Actions
- Included
#boot_application!, #load_environment_config!, | |
#load_generators | See additional method definition at line 36. |
#load_tasks | See additional method definition at line 31. |
#require_application!, | |
#set_application_directory! | Change to the application’s path if there is no |
Class Method Details
.executable(*args)
[ GitHub ]# File 'railties/lib/rails/commands/test/test_command.rb', line 11
def self.executable(*args) args.empty? ? Rails::TestUnitReporter.executable : super end
Instance Method Details
#all(*args)
[ GitHub ]# File 'railties/lib/rails/commands/test/test_command.rb', line 47
def all(*args) perform("test/**/*_test.rb", *args) end
#functionals(*args)
[ GitHub ]# File 'railties/lib/rails/commands/test/test_command.rb', line 52
def functionals(*args) perform("test/controllers", "test/mailers", "test/functional", *args) end
#generators(*args)
[ GitHub ]# File 'railties/lib/rails/commands/test/test_command.rb', line 67
def generators(*args) perform("test/lib/generators", *args) end
#perform(*args)
[ GitHub ]# File 'railties/lib/rails/commands/test/test_command.rb', line 28
def perform(*args) $LOAD_PATH << Rails::Command.root.join("test").to_s Rails::TestUnit::Runner. (args) run_prepare_task if self.args.none?(EXACT_TEST_ARGUMENT_PATTERN) Rails::TestUnit::Runner.run(args) rescue Rails::TestUnit::InvalidTestError => error raise ArgumentError, error. end
#run_prepare_task (private)
[ GitHub ]# File 'railties/lib/rails/commands/test/test_command.rb', line 74
def run_prepare_task Rails::Command::RakeCommand.perform("test:prepare", [], {}) rescue UnrecognizedCommandError => error raise unless error.name == "test:prepare" end
#system(*args)
[ GitHub ]# File 'railties/lib/rails/commands/test/test_command.rb', line 62
def system(*args) perform("test/system", *args) end
#units(*args)
[ GitHub ]# File 'railties/lib/rails/commands/test/test_command.rb', line 57
def units(*args) perform("test/models", "test/helpers", "test/unit", *args) end