Class: Rails::Command::TestCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/rails/commands/test/test_command.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

banner, base_name, class_usage, command_name, default_command_root, desc, engine?, exit_on_failure?, help, hide_command!, inherited, namespace, perform, printing_commands, usage_path

Methods included from Actions

#boot_application!, #load_environment_config!, #load_generators, #load_tasks, #require_application!, #set_application_directory!

Class Method Details

.executable(*args) ⇒ Object



11
12
13
# File '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) ⇒ Object



47
48
49
# File 'lib/rails/commands/test/test_command.rb', line 47

def all(*args)
  perform("test/**/*_test.rb", *args)
end

#functionals(*args) ⇒ Object



52
53
54
# File 'lib/rails/commands/test/test_command.rb', line 52

def functionals(*args)
  perform("test/controllers", "test/mailers", "test/functional", *args)
end

#generators(*args) ⇒ Object



67
68
69
# File 'lib/rails/commands/test/test_command.rb', line 67

def generators(*args)
  perform("test/lib/generators", *args)
end

#perform(*args) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/rails/commands/test/test_command.rb', line 28

def perform(*args)
  $LOAD_PATH << Rails::Command.root.join("test").to_s

  Rails::TestUnit::Runner.parse_options(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.message
end

#system(*args) ⇒ Object



62
63
64
# File 'lib/rails/commands/test/test_command.rb', line 62

def system(*args)
  perform("test/system", *args)
end

#units(*args) ⇒ Object



57
58
59
# File 'lib/rails/commands/test/test_command.rb', line 57

def units(*args)
  perform("test/models", "test/helpers", "test/unit", *args)
end