aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-06-01 18:23:10 +0200
committerYves Senn <yves.senn@gmail.com>2014-06-01 18:23:10 +0200
commit75f75a8719e8dbe8ce14874ae4bd1eac0eee67ab (patch)
treeda321fde5b43d9614b8147af7e57011b24eee3b8 /railties
parent4ae90a7dd8f9857f5d8c90c0135dd873f90e6957 (diff)
parent48b3257582830206b93817e4f519e0b2fe4f9dee (diff)
downloadrails-75f75a8719e8dbe8ce14874ae4bd1eac0eee67ab.tar.gz
rails-75f75a8719e8dbe8ce14874ae4bd1eac0eee67ab.tar.bz2
rails-75f75a8719e8dbe8ce14874ae4bd1eac0eee67ab.zip
Merge pull request #14881 from robin850/patch-19
Swallow bundler exceptions when running tests
Diffstat (limited to 'railties')
-rw-r--r--railties/test/generators/shared_generator_tests.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb
index 8e198d5fe1..b998fef42e 100644
--- a/railties/test/generators/shared_generator_tests.rb
+++ b/railties/test/generators/shared_generator_tests.rb
@@ -78,9 +78,12 @@ module SharedGeneratorTests
end
def test_template_raises_an_error_with_invalid_path
- content = capture(:stderr){ run_generator([destination_root, "-m", "non/existent/path"]) }
- assert_match(/The template \[.*\] could not be loaded/, content)
- assert_match(/non\/existent\/path/, content)
+ quietly do
+ content = capture(:stderr){ run_generator([destination_root, "-m", "non/existent/path"]) }
+
+ assert_match(/The template \[.*\] could not be loaded/, content)
+ assert_match(/non\/existent\/path/, content)
+ end
end
def test_template_is_executed_when_supplied
@@ -89,7 +92,7 @@ module SharedGeneratorTests
template.instance_eval "def read; self; end" # Make the string respond to read
generator([destination_root], template: path).expects(:open).with(path, 'Accept' => 'application/x-thor-template').returns(template)
- assert_match(/It works!/, capture(:stdout) { generator.invoke_all })
+ quietly { assert_match(/It works!/, capture(:stdout) { generator.invoke_all }) }
end
def test_template_is_executed_when_supplied_an_https_path
@@ -98,7 +101,7 @@ module SharedGeneratorTests
template.instance_eval "def read; self; end" # Make the string respond to read
generator([destination_root], template: path).expects(:open).with(path, 'Accept' => 'application/x-thor-template').returns(template)
- assert_match(/It works!/, capture(:stdout) { generator.invoke_all })
+ quietly { assert_match(/It works!/, capture(:stdout) { generator.invoke_all }) }
end
def test_dev_option