Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Reuven committed Dec 17, 2023
1 parent 8357201 commit abfde44
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions checker/api_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,19 @@ func TestApiChange_MultiLineError_NoComment(t *testing.T) {

require.Equal(t, "error\t[change_id] at source\t\n\tin API GET /test\n\t\tThis is a breaking change.", apiChangeNoComment.MultiLineError(MockLocalizer, checker.ColorNever))
}

func TestApiChange_SourceFile(t *testing.T) {
apiChangeSourceFile := apiChange
apiChangeSourceFile.SourceFile = ""
apiChangeSourceFile.Source = load.NewSource("spec.yaml")

require.Equal(t, "spec.yaml", apiChangeSourceFile.GetSourceFile())
}

func TestApiChange_SourceUrl(t *testing.T) {
apiChangeSourceFile := apiChange
apiChangeSourceFile.SourceFile = ""
apiChangeSourceFile.Source = load.NewSource("http://google.com/spec.yaml")

require.Equal(t, "", apiChangeSourceFile.GetSourceFile())
}

0 comments on commit abfde44

Please sign in to comment.