Remove the last comma for Ruby 1.8.7.It causes syntax error.
Get user name from Specinfra.configuration.ssh_options

There is a possibility that Specinfra.configurations.ssh is nill.
Move the place of initializing ssh connection

In Net::SSH object is initialized in the constructor,
test code tries to connect to ssh port really.
Set ssh_options for testing
Create test double for Net::SSH object