generated from skanehira/go-cli-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from kyoshidajp/refactor_strategy_methods
Refactor names
- Loading branch information
Showing
7 changed files
with
131 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package cmd | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestBundlerDoctor_fetchURLFromRepository(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
gem_name string | ||
}{ | ||
{ | ||
name: "source_code_uri exists", | ||
gem_name: "rails", | ||
}, | ||
{ | ||
name: "no source_code_uri, but homepage_uri exists", | ||
gem_name: "minitest", | ||
}, | ||
} | ||
expects := []struct { | ||
name string | ||
url string | ||
}{ | ||
{ | ||
name: "source_code_uri exists", | ||
url: "https://github.com/rails/rails", | ||
}, | ||
{ | ||
name: "no source_code_uri, but homepage_uri exists", | ||
url: "https://github.com/minitest/minitest", | ||
}, | ||
} | ||
|
||
for i, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
s := BundlerDoctor{} | ||
r, _ := s.fetchURLFromRepository(tt.gem_name) | ||
expect := expects[i] | ||
assert.Equal(t, true, strings.HasPrefix(r, expect.url)) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.