aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-04-04 09:44:51 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-04-04 09:44:51 +0900
commit464d625324accb8486aefa0b4a4b46477462dd08 (patch)
tree9a5a0124ac3ddbb98b5a646f2ef93ea86c91c62a /railties
parent1f235a69a37e1df3b08ed2c39cd0086d9c4cfdb7 (diff)
downloadrails-464d625324accb8486aefa0b4a4b46477462dd08.tar.gz
rails-464d625324accb8486aefa0b4a4b46477462dd08.tar.bz2
rails-464d625324accb8486aefa0b4a4b46477462dd08.zip
Remove redundant begin block
We have `Style/RedundantBegin` cop (#34764) but it could not correct in this case.
Diffstat (limited to 'railties')
-rw-r--r--railties/test/generators/app_generator_test.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 6bbb12f433..3bdbc70990 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -681,17 +681,16 @@ class AppGeneratorTest < Rails::Generators::TestCase
def test_inclusion_of_listen_related_configuration_on_other_rubies
ruby_engine = Object.send(:remove_const, :RUBY_ENGINE)
Object.const_set(:RUBY_ENGINE, "MyRuby")
- begin
- run_generator
- if RbConfig::CONFIG["host_os"] =~ /darwin|linux/
- assert_listen_related_configuration
- else
- assert_no_listen_related_configuration
- end
- ensure
- Object.send(:remove_const, :RUBY_ENGINE)
- Object.const_set(:RUBY_ENGINE, ruby_engine)
+
+ run_generator
+ if RbConfig::CONFIG["host_os"] =~ /darwin|linux/
+ assert_listen_related_configuration
+ else
+ assert_no_listen_related_configuration
end
+ ensure
+ Object.send(:remove_const, :RUBY_ENGINE)
+ Object.const_set(:RUBY_ENGINE, ruby_engine)
end
def test_non_inclusion_of_listen_related_configuration_if_skip_listen