Skip to content

Commit 1d32341

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

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-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: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@ 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+
line.chomp!
26+
lines << line
27+
end
28+
end
29+
2130
# Necessary to ignore warnings from Rails code base
22-
out = io.readlines
31+
out = lines
2332
.reject { |line| line =~ /warning: circular argument reference/ }
2433
.reject { |line| line =~ /Gem::Specification#rubyforge_project=/ }
2534
.reject { |line| line =~ /DEPRECATION WARNING/ }

0 commit comments

Comments
 (0)