Skip to content

Commit

Permalink
Added documentation and test for default-session-options
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoduncan committed Mar 7, 2010
1 parent d0621d3 commit 11972f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ key in your $HOME/.ssh directory.

(ssh "hostname" "ls")

Strict host key checking can be turned off.

(default-session-options {:strict-host-key-checking :no})

More advance usage is possible.

(with-ssh-agent []
Expand Down
4 changes: 4 additions & 0 deletions src/clj_ssh/ssh.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ key in your $HOME/.ssh directory.
(ssh hostname cmd)
Strict host key checking can be turned off.
(default-session-options {:strict-host-key-checking :no})
More advance usage is possible.
(with-ssh-agent []
Expand Down
8 changes: 8 additions & 0 deletions test/clj_ssh/ssh_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ list, Alan Dipert and MeikelBrandmeyer."
(deftest default-identity-test
(is (= (private-key-path) (.getPath (default-identity)))))

(deftest default-session-options-test
(let [old *default-session-options*
new {:strict-host-key-checking :no}]
(default-session-options new)
(is (= new *default-session-options*))
(default-session-options old)
(is (= old *default-session-options*))))

(deftest ssh-agent?-test
(is (ssh-agent? (com.jcraft.jsch.JSch.)))
(is (not (ssh-agent? "i'm not an ssh-agent"))))
Expand Down

0 comments on commit 11972f6

Please sign in to comment.