diff --git a/spec/std/socket/socket_spec.cr b/spec/std/socket/socket_spec.cr index 0049a564a96e..23b7229db88d 100644 --- a/spec/std/socket/socket_spec.cr +++ b/spec/std/socket/socket_spec.cr @@ -19,6 +19,12 @@ describe Socket, tags: "network" do end end + describe "#tty?" do + it "with non TTY" do + Socket.new(Socket::Family::INET, Socket::Type::STREAM, Socket::Protocol::TCP).tty?.should be_false + end + end + pending_win32 ".accept" do client_done = Channel(Nil).new server = Socket.new(Socket::Family::INET, Socket::Type::STREAM, Socket::Protocol::TCP) diff --git a/src/crystal/system/win32/socket.cr b/src/crystal/system/win32/socket.cr index 339f28648200..41f657e21ef5 100644 --- a/src/crystal/system/win32/socket.cr +++ b/src/crystal/system/win32/socket.cr @@ -335,7 +335,7 @@ module Crystal::System::Socket end private def system_tty? - LibC.isatty(fd) == 1 + false end private def unbuffered_read(slice : Bytes)