spec/session_command_spec.rb in net-ssh-session-0.1.2 vs spec/session_command_spec.rb in net-ssh-session-0.1.3

- old
+ new

@@ -56,6 +56,16 @@ it 'returns command string representation' do cmd = Net::SSH::SessionCommand.new('cmd', 'output', '0', 1.234) cmd.to_s.should eq("[cmd] => 0, 6 bytes, 1.234 seconds") end end + + describe '#to_hash' do + it 'returns command hash representation' do + cmd = Net::SSH::SessionCommand.new('cmd', 'output', '0', 1.234) + hash = cmd.to_hash + + hash.should include 'command', 'output', 'exit_code' + hash.should include 'start_time', 'finish_time', 'duration' + end + end end \ No newline at end of file