Skip to content

Commit 464d625

Browse files
committed
Remove redundant begin block
We have `Style/RedundantBegin` cop (rails#34764) but it could not correct in this case.
1 parent 1f235a6 commit 464d625

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

railties/test/generators/app_generator_test.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -681,17 +681,16 @@ def test_inclusion_of_listen_related_configuration_by_default
681681
def test_inclusion_of_listen_related_configuration_on_other_rubies
682682
ruby_engine = Object.send(:remove_const, :RUBY_ENGINE)
683683
Object.const_set(:RUBY_ENGINE, "MyRuby")
684-
begin
685-
run_generator
686-
if RbConfig::CONFIG["host_os"] =~ /darwin|linux/
687-
assert_listen_related_configuration
688-
else
689-
assert_no_listen_related_configuration
690-
end
691-
ensure
692-
Object.send(:remove_const, :RUBY_ENGINE)
693-
Object.const_set(:RUBY_ENGINE, ruby_engine)
684+
685+
run_generator
686+
if RbConfig::CONFIG["host_os"] =~ /darwin|linux/
687+
assert_listen_related_configuration
688+
else
689+
assert_no_listen_related_configuration
694690
end
691+
ensure
692+
Object.send(:remove_const, :RUBY_ENGINE)
693+
Object.const_set(:RUBY_ENGINE, ruby_engine)
695694
end
696695

697696
def test_non_inclusion_of_listen_related_configuration_if_skip_listen

0 commit comments

Comments
 (0)