Skip to content

Commit

Permalink
Fixing the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramesh7 committed Oct 9, 2023
1 parent 0983204 commit a4dce46
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion internal/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func changelogWithSingleEntry(entry entry.Entry, repoName, repoOwner string) cha
entry.Next = nil
entry.Previous = nil

cl := changelog.NewChangelog(repoName, repoOwner)
cl := changelog.NewChangelog(repoOwner, repoName)
cl.Insert(entry)
return cl
}
Expand Down
2 changes: 1 addition & 1 deletion internal/writer/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
)

func Test_ItWritesOutAChangelogInTheCorrectFormat(t *testing.T) {
mockChangelog := changelog.NewChangelog(repoName, repoOwner)
mockChangelog := changelog.NewChangelog(repoOwner, repoName)

entry := entry.Entry{
Tag: "v1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion pkg/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func NewBuilder(options BuilderOptions) (Builder, error) {
}

changelog := changelog.NewChangelog(
options.GitHubClient.GetRepoName(),
options.GitHubClient.GetRepoOwner(),
options.GitHubClient.GetRepoName()

Check failure on line 73 in pkg/builder/builder.go

View workflow job for this annotation

GitHub Actions / ci

syntax error: unexpected newline in argument list; possibly missing comma or ) (typecheck)

Check failure on line 73 in pkg/builder/builder.go

View workflow job for this annotation

GitHub Actions / ci

missing ',' before newline in argument list (typecheck)

Check failure on line 73 in pkg/builder/builder.go

View workflow job for this annotation

GitHub Actions / ci

syntax error: unexpected newline in argument list; possibly missing comma or )) (typecheck)

Check failure on line 73 in pkg/builder/builder.go

View workflow job for this annotation

GitHub Actions / ci

syntax error: unexpected newline in argument list; possibly missing comma or )) (typecheck)
)

builder := &builder{
Expand Down
12 changes: 6 additions & 6 deletions pkg/changelog/changelog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ var entries = []entry.Entry{
}

func TetstNewChangelog(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
assert.Equal(t, repoName, testChangelog.GetRepoName())
assert.Equal(t, repoOwner, testChangelog.GetRepoOwner())
assert.Equal(t, 0, len(testChangelog.GetEntries()))
assert.Equal(t, 0, len(testChangelog.GetUnreleased()))
}

func TestInsert(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
for _, e := range entries {
err := e.Append("added", "test")
assert.Nil(t, err)
Expand All @@ -49,7 +49,7 @@ func TestInsert(t *testing.T) {
}

func TestTail(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)

for _, e := range entries {
err := e.Append("added", "test")
Expand All @@ -63,7 +63,7 @@ func TestTail(t *testing.T) {
}

func TestHead(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
entries := []entry.Entry{
{
Tag: "v2.0.0",
Expand All @@ -87,7 +87,7 @@ func TestHead(t *testing.T) {
}

func TestAddUnreleased(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
testChangelog.AddUnreleased([]string{"test"})

unreleased := testChangelog.GetUnreleased()
Expand All @@ -97,7 +97,7 @@ func TestAddUnreleased(t *testing.T) {
}

func TestGetEntries(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
for _, e := range entries {
err := e.Append("added", "test")
assert.Nil(t, err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/entry/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestNewEntry(t *testing.T) {
}

func TestPrevious(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
entries := []entry.Entry{
{
Tag: "v2.0.0",
Expand All @@ -48,7 +48,7 @@ func TestPrevious(t *testing.T) {
}

func TestNext(t *testing.T) {
var testChangelog = changelog.NewChangelog(repoName, repoOwner)
var testChangelog = changelog.NewChangelog(repoOwner, repoName)
entries := []entry.Entry{
{
Tag: "v2.0.0",
Expand Down

0 comments on commit a4dce46

Please sign in to comment.