Skip to content
Permalink
Browse files

Renamed set status method to be public

  • Loading branch information...
kiriappeee committed Mar 25, 2018
1 parent 2a51da8 commit 0f9f7d45d2f3f5948e434b86389d9cc7fe9365e6
Showing with 3 additions and 3 deletions.
  1. +1 −1 setstatus.go
  2. +2 −2 setstatus_test.go
@@ -42,6 +42,6 @@ func ConvertTextToStructArray(textToConvert string) ([]Status, error) {
return statusesToReturn, nil
}

func (s *Status) setMyStatus(fn UpdateStatus, apiToken string) (string, error) {
func (s *Status) SetMyStatus(fn UpdateStatus, apiToken string) (string, error) {
return fn(s, apiToken)
}
@@ -212,7 +212,7 @@ func TestAnErrorIsThrownWhenADuplicateValueExists(t *testing.T){

func TestSetStatusMethodIsCalled(t *testing.T){
s := Status{"lunch", "chompy", "Having lunch"}
result, err := s.setMyStatus(updateStatusViaAPIMock, "mytoken")
result, err := s.SetMyStatus(updateStatusViaAPIMock, "mytoken")
if err != nil {
t.Fatalf("Error was not nil. Received: %s", err.Error())
}
@@ -221,7 +221,7 @@ func TestSetStatusMethodIsCalled(t *testing.T){
}

s = Status{"lunch", "chompy", "eating"}
result, err = s.setMyStatus(updateStatusViaAPIMock, "mytoken")
result, err = s.SetMyStatus(updateStatusViaAPIMock, "mytoken")
if err == nil {
t.Fatalf("Error was nil. Expected an error")
}

0 comments on commit 0f9f7d4

Please sign in to comment.
You can’t perform that action at this time.