File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -40,18 +40,28 @@ func TestNew_shouldReturnValidDetails(t *testing.T) {
4040 }
4141}
4242
43+ func TestNew_shouldReadFromDefaultFolder_whenBasePathNotSet (t * testing.T ) {
44+ config , configErr := New ()
45+
46+ require .NotNil (t , config )
47+ assert .NoError (t , configErr )
48+ assert .EqualValues (t , "private_key.pem" , config .Jwt .PrivateKey )
49+ assert .EqualValues (t , "public_key.pem" , config .Jwt .PublicKey )
50+ assert .EqualValues (t , "config/keys" , config .Jwt .Directory )
51+ assert .True (t , config .Jwt .GenerateKeys )
52+ }
53+
4354func TestNew_shouldReturnError_whenUnableToReadFile (t * testing.T ) {
44- t .Skip ("skipping because of monkey patch comaptiblity" )
4555 errMsg := "test error message while opening file"
4656 defer monkey .UnpatchAll ()
4757 patchOsOpen (errMsg )
4858
4959 err := os .Setenv (BASE_PATH , "/path/to/config" )
5060
51- config , configErr := New ()
61+ config := & Config {}
62+ configErr := config .InitConfig ()
5263
5364 require .NoError (t , err )
54- require .Nil (t , config )
5565 assert .Error (t , configErr )
5666 assert .EqualValues (t , errMsg , configErr .Error ())
5767}
You can’t perform that action at this time.
0 commit comments