TransportException should be raised when Socket is not open instead of IOError
diff --git a/lib/rb/spec/socket_spec_shared.rb b/lib/rb/spec/socket_spec_shared.rb
index 32bdb71..2015ac0 100644
--- a/lib/rb/spec/socket_spec_shared.rb
+++ b/lib/rb/spec/socket_spec_shared.rb
@@ -67,8 +67,8 @@
@socket.open
allow(@handle).to receive(:closed?).and_return(true)
expect(@socket).not_to be_open
- expect { @socket.write("fail") }.to raise_error(IOError, "closed stream")
- expect { @socket.read(10) }.to raise_error(IOError, "closed stream")
+ expect { @socket.write("fail") }.to raise_error(Thrift::TransportException, "closed stream") { |e| expect(e.type).to eq(Thrift::TransportException::NOT_OPEN) }
+ expect { @socket.read(10) }.to raise_error(Thrift::TransportException, "closed stream") { |e| expect(e.type).to eq(Thrift::TransportException::NOT_OPEN) }
end
it "should support the timeout accessor for read" do