From 090c83672f333d6a4d87752ca1f980bfb6be6849 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Thu, 29 Jan 2015 15:03:08 +0100 Subject: `-e` / `--environment` for the test runner. --- railties/test/test_unit/runner_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'railties/test/test_unit') diff --git a/railties/test/test_unit/runner_test.rb b/railties/test/test_unit/runner_test.rb index be226e3aa5..cd0c66a5f7 100644 --- a/railties/test/test_unit/runner_test.rb +++ b/railties/test/test_unit/runner_test.rb @@ -19,6 +19,16 @@ class TestUnitTestRunnerTest < ActiveSupport::TestCase assert options[:backtrace] end + test "tests run in the test environment by default" do + options = @options.parse([]) + assert_equal "test", options[:environment] + end + + test "can run in a specific environment" do + options = @options.parse(["-e development"]) + assert_equal "development", options[:environment] + end + test "parse the filename and line" do options = @options.parse(["foobar.rb:20"]) assert_equal File.expand_path("foobar.rb"), options[:filename] @@ -52,4 +62,8 @@ class TestUnitTestRunnerTest < ActiveSupport::TestCase assert_nil options[:filename] assert_nil options[:line] end + + test "run multiple files" do + skip "needs implementation" + end end -- cgit v1.2.3