Permalink
Browse files

Added test for plus sign support in sshconfig hostname (Ruby 1.8)

  • Loading branch information...
1 parent da383ec commit b0dd0c8f25cc1f3626e08f1b1df8226e8a7aabd3 @delano delano committed Jan 16, 2010
Showing with 16 additions and 1 deletion.
  1. +10 −0 test/configs/host_plus
  2. +6 −1 test/test_config.rb
View
@@ -0,0 +1,10 @@
+# Jump through hosts with one SSH call
+# via <http://glandium.org/blog/?p=308>
+Host *+*
+ ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') PATH=.:\$PATH nc -w1 $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
+
+Host office-offsite
+ HostName work-gateway+office-workstation
+
+Host test.host
+ Compression yes
View
@@ -90,7 +90,12 @@ def test_translate_should_correctly_translate_from_openssh_to_net_ssh_names
assert_equal 1234, net_ssh[:port]
assert_equal 1024, net_ssh[:rekey_limit]
end
-
+
+ def test_load_with_plus_sign_hosts
+ config = Net::SSH::Config.load(config(:host_plus), "test.host")
+ assert config['compression']
+ end
+
private
def config(name)

0 comments on commit b0dd0c8

Please sign in to comment.