> Is there any reason why this is a whitebox test?
Yes, so the tests can mock out "sshCommand". See the call to jc.Set in
SetUpSuite.
https://codereview.appspot.com/13660047/diff/7001/environs/sshstorage/storage_test.go#newcode74
environs/sshstorage/storage_test.go:74: func (s *storageSuite)
makeStorage(c *gc.C) (storage *SSHStorage, storageDir string) {
On 2013/09/18 21:30:56, thumper wrote:
> Why name the return parameters here? You aren't really gaining much.
Is it just
> to provide more assistance to the reader?
Yes, that was my rationale; I don't want to have to look at the
implementation to know what the result is.
It could be a doc comment, but in this case a self-documenting named
result is an easy win.
https:/ /codereview. appspot. com/13660047/ diff/7001/ environs/ sshstorage/ storage_ test.go sshstorage/ storage_ test.go (right):
File environs/
https:/ /codereview. appspot. com/13660047/ diff/7001/ environs/ sshstorage/ storage_ test.go# newcode4 sshstorage/ storage_ test.go: 4: package sshstorage
environs/
On 2013/09/18 21:30:56, thumper wrote:
> Normally the tests would be in sshstorage_test package.
> Is there any reason why this is a whitebox test?
Yes, so the tests can mock out "sshCommand". See the call to jc.Set in
SetUpSuite.
https:/ /codereview. appspot. com/13660047/ diff/7001/ environs/ sshstorage/ storage_ test.go# newcode74 sshstorage/ storage_ test.go: 74: func (s *storageSuite)
environs/
makeStorage(c *gc.C) (storage *SSHStorage, storageDir string) {
On 2013/09/18 21:30:56, thumper wrote:
> Why name the return parameters here? You aren't really gaining much.
Is it just
> to provide more assistance to the reader?
Yes, that was my rationale; I don't want to have to look at the
implementation to know what the result is.
It could be a doc comment, but in this case a self-documenting named
result is an easy win.
https:/ /codereview. appspot. com/13660047/