diff --git a/spec/run_spec.cr b/spec/run_spec.cr index 818cbe9..ec89d23 100644 --- a/spec/run_spec.cr +++ b/spec/run_spec.cr @@ -5,12 +5,12 @@ private def run(code) require "./src/kemal" #{code} CR - String.build do |stdout| - stderr = String.build do |io| - Process.new("crystal", ["eval"], input: IO::Memory.new(code), output: stdout, error: io).wait - end - fail(stderr) unless stderr.empty? - end + + stdout = IO::Memory.new + stderr = IO::Memory.new + status = Process.new("crystal", ["eval"], input: IO::Memory.new(code), output: stdout, error: stderr).wait + fail(stderr.to_s) unless status.success? + stdout.to_s end describe "Run" do