Skip to content

Commit dbaa79f

Browse files
committed
Rework exit status capturing
1 parent d44f007 commit dbaa79f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

example_app_generator/spec/support/default_preview_path

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ require_file_stub 'config/environment' do
6565
Rails.application.initialize!
6666
end
6767

68-
exit if ENV['NO_ACTION_MAILER']
68+
exit(0) if ENV['NO_ACTION_MAILER']
6969
if ENV['DEFAULT_URL']
7070
puts ActionMailer::Base.default_url_options[:host]
7171
elsif defined?(::ActionMailer::Preview)
@@ -79,3 +79,4 @@ end
7979
# This will force the loading of ActionMailer settings to ensure we do not
8080
# accidentally set something we should not
8181
ActionMailer::Base.smtp_settings
82+
exit 0

example_app_generator/spec/verify_mailer_preview_path_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@ def as_commandline(ops)
1717

1818
def capture_exec(*ops)
1919
ops << { err: [:child, :out] }
20-
io = IO.popen(ops)
20+
lines = []
21+
22+
_process =
23+
IO.popen(ops) do |io|
24+
while (line = io.gets)
25+
lines << line
26+
end
27+
end
28+
2129
# Necessary to ignore warnings from Rails code base
22-
out = io.readlines
30+
out = lines
2331
.reject { |line| line =~ /warning: circular argument reference/ }
2432
.reject { |line| line =~ /Gem::Specification#rubyforge_project=/ }
2533
.reject { |line| line =~ /DEPRECATION WARNING/ }

0 commit comments

Comments
 (0)