spec/async/io/protocol/line_spec.rb in async-io-1.27.2 vs spec/async/io/protocol/line_spec.rb in async-io-1.27.3
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
# Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@@ -26,10 +28,10 @@
let(:pipe) {@pipe = Async::IO::Socket.pair(Socket::AF_UNIX, Socket::SOCK_STREAM)}
let(:remote) {pipe.first}
subject {described_class.new(Async::IO::Stream.new(pipe.last, deferred: true), "\n")}
- after(:each) {@pipe&.each(&:close)}
+ after(:each) {defined?(@pipe) && @pipe&.each(&:close)}
context "default line ending" do
subject {described_class.new(nil)}
it "should have default eol terminator" do