Methods
- S
- T
-
- teardown,
- test_generated_scaffold_works_with_rails_test,
- test_load_fixtures_when_running_test_suites,
- test_run_all_suites,
- test_run_controllers,
- test_run_different_environment_using_e_tag,
- test_run_different_environment_using_env_var,
- test_run_file_with_syntax_error,
- test_run_functionals,
- test_run_helpers,
- test_run_in_test_environment,
- test_run_integration,
- test_run_jobs,
- test_run_mailers,
- test_run_matched_test,
- test_run_models,
- test_run_multiple_files,
- test_run_named_test,
- test_run_single_file,
- test_run_units,
- test_run_with_model
Included Modules
Instance Public methods
setup()
Link
teardown()
Link
test_generated_scaffold_works_with_rails_test()
Link
test_load_fixtures_when_running_test_suites()
Link
# File railties/test/application/test_runner_test.rb, line 196 def test_load_fixtures_when_running_test_suites create_model_with_fixture suites = [:models, :helpers, [:units, :unit], :controllers, :mailers, [:functionals, :functional], :integration] suites.each do |suite, directory| directory ||= suite create_fixture_test directory assert_match "3 users", run_task(["test:#{suite}"]) Dir.chdir(app_path) { FileUtils.rm_f "test/#{directory}" } end end
test_run_all_suites()
Link
# File railties/test/application/test_runner_test.rb, line 145 def test_run_all_suites suites = [:models, :helpers, :unit, :controllers, :mailers, :functional, :integration, :jobs] suites.each { |suite| create_test_file suite, "foo_#{suite}" } run_test_command('') .tap do |output| suites.each { |suite| assert_match "Foo#{suite.to_s.camelize}Test", output } assert_match "8 runs, 8 assertions, 0 failures", output end end
test_run_controllers()
Link
# File railties/test/application/test_runner_test.rb, line 90 def test_run_controllers create_test_file :controllers, 'foo_controller' create_test_file :controllers, 'bar_controller' create_test_file :models, 'foo' run_test_controllers_command.tap do |output| assert_match "FooControllerTest", output assert_match "BarControllerTest", output assert_match "2 runs, 2 assertions, 0 failures", output end end
test_run_different_environment_using_e_tag()
Link
# File railties/test/application/test_runner_test.rb, line 231 def test_run_different_environment_using_e_tag env = "development" app_file 'test/unit/env_test.rb', <<-RUBY require 'test_helper' class EnvTest < ActiveSupport::TestCase def test_env puts Rails.env end end RUBY assert_match env, run_test_command("test/unit/env_test.rb RAILS_ENV=#{env}") end
test_run_different_environment_using_env_var()
Link
# File railties/test/application/test_runner_test.rb, line 216 def test_run_different_environment_using_env_var app_file 'test/unit/env_test.rb', <<-RUBY require 'test_helper' class EnvTest < ActiveSupport::TestCase def test_env puts Rails.env end end RUBY ENV['RAILS_ENV'] = 'development' assert_match "development", run_test_command('test/unit/env_test.rb') end
test_run_file_with_syntax_error()
Link
# File railties/test/application/test_runner_test.rb, line 44 def test_run_file_with_syntax_error app_file 'test/models/error_test.rb', <<-RUBY require 'test_helper' def; end RUBY error_stream = Tempfile.new('error') redirect_stderr(error_stream) { run_test_command('test/models/error_test.rb') } assert_match "syntax error", error_stream.read end
test_run_functionals()
Link
# File railties/test/application/test_runner_test.rb, line 123 def test_run_functionals create_test_file :mailers, 'foo_mailer' create_test_file :controllers, 'bar_controller' create_test_file :functional, 'baz_functional' create_test_file :models, 'foo' run_test_functionals_command.tap do |output| assert_match "FooMailerTest", output assert_match "BarControllerTest", output assert_match "BazFunctionalTest", output assert_match "3 runs, 3 assertions, 0 failures", output end end
test_run_helpers()
Link
# File railties/test/application/test_runner_test.rb, line 66 def test_run_helpers create_test_file :helpers, 'foo_helper' create_test_file :helpers, 'bar_helper' create_test_file :controllers, 'foobar_controller' run_test_helpers_command.tap do |output| assert_match "FooHelperTest", output assert_match "BarHelperTest", output assert_match "2 runs, 2 assertions, 0 failures", output end end
test_run_in_test_environment()
Link
# File railties/test/application/test_runner_test.rb, line 18 def test_run_in_test_environment app_file 'test/unit/env_test.rb', <<-RUBY require 'test_helper' class EnvTest < ActiveSupport::TestCase def test_env puts "Current Environment: \#{Rails.env}" end end RUBY assert_match "Current Environment: test", run_test_command('test/unit/env_test.rb') end
test_run_integration()
Link
# File railties/test/application/test_runner_test.rb, line 136 def test_run_integration create_test_file :integration, 'foo_integration' create_test_file :models, 'foo' run_test_integration_command.tap do |output| assert_match "FooIntegration", output assert_match "1 runs, 1 assertions, 0 failures", output end end
test_run_jobs()
Link
# File railties/test/application/test_runner_test.rb, line 112 def test_run_jobs create_test_file :jobs, 'foo_job' create_test_file :jobs, 'bar_job' create_test_file :models, 'foo' run_test_jobs_command.tap do |output| assert_match "FooJobTest", output assert_match "BarJobTest", output assert_match "2 runs, 2 assertions, 0 failures", output end end
test_run_mailers()
Link
# File railties/test/application/test_runner_test.rb, line 101 def test_run_mailers create_test_file :mailers, 'foo_mailer' create_test_file :mailers, 'bar_mailer' create_test_file :models, 'foo' run_test_mailers_command.tap do |output| assert_match "FooMailerTest", output assert_match "BarMailerTest", output assert_match "2 runs, 2 assertions, 0 failures", output end end
test_run_matched_test()
Link
# File railties/test/application/test_runner_test.rb, line 175 def test_run_matched_test app_file 'test/unit/chu_2_koi_test.rb', <<-RUBY require 'test_helper' class Chu2KoiTest < ActiveSupport::TestCase def test_rikka puts 'Rikka' end def test_sanae puts 'Sanae' end end RUBY run_test_command('test/unit/chu_2_koi_test.rb /rikka/').tap do |output| assert_match "Rikka", output assert_no_match "Sanae", output end end
test_run_models()
Link
# File railties/test/application/test_runner_test.rb, line 55 def test_run_models create_test_file :models, 'foo' create_test_file :models, 'bar' create_test_file :controllers, 'foobar_controller' run_test_models_command.tap do |output| assert_match "FooTest", output assert_match "BarTest", output assert_match "2 runs, 2 assertions, 0 failures", output end end
test_run_multiple_files()
Link
test_run_named_test()
Link
# File railties/test/application/test_runner_test.rb, line 154 def test_run_named_test app_file 'test/unit/chu_2_koi_test.rb', <<-RUBY require 'test_helper' class Chu2KoiTest < ActiveSupport::TestCase def test_rikka puts 'Rikka' end def test_sanae puts 'Sanae' end end RUBY run_test_command('test/unit/chu_2_koi_test.rb test_rikka').tap do |output| assert_match "Rikka", output assert_no_match "Sanae", output end end
test_run_single_file()
Link
test_run_units()
Link
# File railties/test/application/test_runner_test.rb, line 77 def test_run_units create_test_file :models, 'foo' create_test_file :helpers, 'bar_helper' create_test_file :unit, 'baz_unit' create_test_file :controllers, 'foobar_controller' run_test_units_command.tap do |output| assert_match "FooTest", output assert_match "BarHelperTest", output assert_match "BazUnitTest", output assert_match "3 runs, 3 assertions, 0 failures", output end end
test_run_with_model()
Link