Skip to content

Commit

Permalink
Merge pull request #184 from zaquestion/robust_list_tests
Browse files Browse the repository at this point in the history
(tests) make list tests more robust
  • Loading branch information
zaquestion authored Jul 16, 2018
2 parents a75e9b8 + 9983bb0 commit 9032be9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# git + lab = gitlab [![Build Status](https://travis-ci.org/zaquestion/lab.svg?branch=master)](https://travis-ci.org/zaquestion/lab) [![Go Report Card](https://goreportcard.com/badge/github.com/zaquestion/lab)](https://goreportcard.com/report/github.com/zaquestion/lab) [![codecov](https://codecov.io/gh/zaquestion/lab/branch/master/graph/badge.svg)](https://codecov.io/gh/zaquestion/lab) [![Join the chat at https://gitter.im/labcli](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/labcli)

<p align="center"><img src="https://user-images.githubusercontent.com/2358914/34196973-420d389a-e519-11e7-92e6-3a1486d6b280.png" align="center" height="350"></p>

<p align="center"><img src="https://user-images.githubusercontent.com/1964720/42740177-6478d834-8858-11e8-9667-97f193ecb404.gif" align="center"></p>

Lab wraps Git or [Hub](https://github.com/github/hub), making it simple to clone, fork, and interact with repositories on GitLab, including seamless workflows for creating merge requests, issues and snippets.

Expand All @@ -11,8 +12,6 @@ $ lab clone gitlab-com/infrastructure
$ git clone git@gitlab.com:gitlab-com/infrastructure
```

<p align="center"><img src="https://user-images.githubusercontent.com/1964720/42740177-6478d834-8858-11e8-9667-97f193ecb404.gif" align="center"></p>

## hub + lab = hublab??

lab will look for hub and uses that as your git binary when available so you don't have to give up hub to use lab
Expand Down Expand Up @@ -81,3 +80,5 @@ Like hub, lab feels best when aliased as `git`. In your `.bashrc` or `.bash_prof
```
alias git=lab
```

<p align="center"><img src="https://user-images.githubusercontent.com/2358914/34196973-420d389a-e519-11e7-92e6-3a1486d6b280.png" align="center"></p>
6 changes: 3 additions & 3 deletions cmd/issue_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Test_issueList(t *testing.T) {

issues := strings.Split(string(b), "\n")
t.Log(issues)
require.Equal(t, "#1 test issue for lab list", issues[0])
require.Contains(t, issues, "#1 test issue for lab list")
}

func Test_issueListFlagLabel(t *testing.T) {
Expand All @@ -37,7 +37,7 @@ func Test_issueListFlagLabel(t *testing.T) {

issues := strings.Split(string(b), "\n")
t.Log(issues)
require.Equal(t, "#3 test filter labels 1", issues[0])
require.Contains(t, issues, "#3 test filter labels 1")
}

func Test_issueListStateClosed(t *testing.T) {
Expand All @@ -53,5 +53,5 @@ func Test_issueListStateClosed(t *testing.T) {

issues := strings.Split(string(b), "\n")
t.Log(issues)
require.Equal(t, "#4 test closed issue", issues[0])
require.Contains(t, issues, "#4 test closed issue")
}
11 changes: 6 additions & 5 deletions cmd/mr_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Test_mrList(t *testing.T) {

mrs := strings.Split(string(b), "\n")
t.Log(mrs)
require.Equal(t, "#1 Test MR for lab list", mrs[0])
require.Contains(t, mrs, "#1 Test MR for lab list")
}

func Test_mrListFlagLabel(t *testing.T) {
Expand All @@ -37,7 +37,7 @@ func Test_mrListFlagLabel(t *testing.T) {

mrs := strings.Split(string(b), "\n")
t.Log(mrs)
require.Equal(t, "#3 for testings filtering with labels and lists", mrs[0])
require.Contains(t, mrs, "#3 for testings filtering with labels and lists")
}

func Test_mrListStateMerged(t *testing.T) {
Expand All @@ -53,7 +53,7 @@ func Test_mrListStateMerged(t *testing.T) {

mrs := strings.Split(string(b), "\n")
t.Log(mrs)
require.Equal(t, "#4 merged merge request", mrs[0])
require.Contains(t, mrs, "#4 merged merge request")
}

func Test_mrListStateClosed(t *testing.T) {
Expand All @@ -69,7 +69,8 @@ func Test_mrListStateClosed(t *testing.T) {

mrs := strings.Split(string(b), "\n")
t.Log(mrs)
require.Equal(t, "#5 closed mr", mrs[0])
require.Contains(t, mrs, "#5 closed mr")

}

func Test_mrListFivePerPage(t *testing.T) {
Expand All @@ -85,5 +86,5 @@ func Test_mrListFivePerPage(t *testing.T) {

mrs := strings.Split(string(b), "\n")
t.Log(mrs)
require.Equal(t, "#1 Test MR for lab list", mrs[0])
require.Contains(t, mrs, "#1 Test MR for lab list")
}

0 comments on commit 9032be9

Please sign in to comment.