spec/sockit/sockit_spec.rb in sockit-1.1.0 vs spec/sockit/sockit_spec.rb in sockit-1.1.1

- old
+ new

@@ -87,125 +87,5 @@ end end end - -describe TCPSocket do - - describe "connections" do - - describe "direct" do - - it "should allow a direct connection to github" do - Sockit.config do |config| - config.version = nil - config.host = nil - config.port = nil - end - - socket = TCPSocket.new('github.com', '22') - data = socket.gets - expect(data).to match(/SSH/) - end - - end - - describe "SOCKS v5" do - - it "should allow a SOCKS v4 connection to github (no debug/no auth)" do - Sockit.config do |config| - config.debug = false - config.version = 4 - config.host = "127.0.0.1" - config.port = "1080" - config.username = nil - config.password = nil - end - - socket = TCPSocket.new('github.com', '22') - data = socket.gets - expect(data).to match(/SSH/) - end - - it "should allow a SOCKS v5 connection to github (no debug/no auth)" do - Sockit.config do |config| - config.debug = false - config.version = 5 - config.host = "127.0.0.1" - config.port = "1080" - config.username = nil - config.password = nil - end - - socket = TCPSocket.new('github.com', '22') - data = socket.gets - expect(data).to match(/SSH/) - end - - it "should allow a SOCKS v5 connection to github (debug/no auth)" do - $stdout = File.open('/dev/null', 'w') - - Sockit.config do |config| - config.debug = true - config.version = 5 - config.host = "127.0.0.1" - config.port = "1080" - config.username = nil - config.password = nil - end - - socket = TCPSocket.new('github.com', '22') - data = socket.gets - expect(data).to match(/SSH/) - end - - it "should allow a SOCKS v5 connection to github (no debug/auth)" do - Sockit.config do |config| - config.debug = false - config.version = 5 - config.host = "127.0.0.1" - config.port = "1081" - config.username = "root" - config.password = "none" - end - - socket = TCPSocket.new('github.com', '22') - data = socket.gets - expect(data).to match(/SSH/) - end - - it "should allow a SOCKS v5 connection to github (debug/auth)" do - $stdout = File.open('/dev/null', 'w') - - Sockit.config do |config| - config.debug = true - config.version = 5 - config.host = "127.0.0.1" - config.port = "1081" - config.username = "root" - config.password = "none" - end - - socket = TCPSocket.new('github.com', '22') - data = socket.gets - expect(data).to match(/SSH/) - end - - it "should throw an exception if we use bad credentials (no debug/auth)" do - Sockit.config do |config| - config.debug = false - config.version = 5 - config.host = "127.0.0.1" - config.port = "1081" - config.username = "root" - config.password = "blargh" - end - - expect { TCPSocket.new('github.com', '22') }.to raise_exception(SockitError) - end - - end - - end - -end