Skip to content

Commit

Permalink
fix tests after switching to pkger
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Nov 29, 2019
1 parent 56ef963 commit 0073e0a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion shared/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

func TestConfig(t *testing.T) {
// For Tests, always use relative paths
InitConfig("../../config", "config.prod.yaml")
InitConfig("/config", "config.prod.yaml")
dialect := microConfig.Get("database", "dialect").String("no dialect")
if dialect != "postgres" {
t.Fatalf("Expected %s got %s", "postgres", dialect)
Expand Down
2 changes: 1 addition & 1 deletion shared/email/email_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func TestSendEmail_Send(t *testing.T) {
myConfig.InitConfig("../../config", "config.yaml")
myConfig.InitConfig("/config", "config.yaml")
var emailConf myConfig.EmailConfiguration
config.Get("email").Scan(&emailConf)
myAuth := smtp.PlainAuth("", emailConf.Username, emailConf.Password, emailConf.EmailServer)
Expand Down
4 changes: 2 additions & 2 deletions srv/emailer/service/email.service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (mock *FakeEmailSender) Send(subject, body string, to []string) error {
return args.Error(0)
}
func TestEmailService_Welcome(t *testing.T) {
myConfig.InitConfig("../../../config", "config.yaml")
myConfig.InitConfig("/config", "config.yaml")
emailer := &FakeEmailSender{}
emailer.On("Send",
"Welcome", "Hi Bob!", []string{"[email protected]"}).Return(nil)
Expand All @@ -39,7 +39,7 @@ func TestEmailService_Welcome_Integration(t *testing.T) {
if testing.Short() {
t.Skip("skipping long integration test")
}
myConfig.InitConfig("../../../config", "config.test.yaml")
myConfig.InitConfig("/config", "config.prod.yaml")
config.Scan(&cfg)
emailer := email.NewSendEmail(&cfg.Email)
emailService := NewEmailService(emailer)
Expand Down

0 comments on commit 0073e0a

Please sign in to comment.