Skip to content

Commit

Permalink
services: added services feature description & test implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
phiros committed Apr 15, 2019
1 parent e7606a9 commit 3402b6b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (c *cmdTest) shouldReturnTheFollowing(arg1 string, arg2 *gherkin.DocString)
if err != nil {
return err
}
return assertEqual(arg2.Content, string(actualOutput))
return assertEqual(strings.TrimSpace(arg2.Content), strings.TrimSpace(string(actualOutput)))
}

func assertEqual(expected, actual string) error {
Expand Down
31 changes: 31 additions & 0 deletions tests/features/services.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Feature: projects
In order to use mite in a sane manner
As a mite user
I need to be able to list projects

Scenario: list services
Given A local mock server is setup for the http method "GET" and path "/services.json" which returns:
"""
[
{
"service": {
"id": 38672,
"name": "Website Konzeption",
"note": "",
"hourly_rate": 3300,
"archived": false,
"billable": true,
"created_at": "2009-12-13T12:12:00+01:00",
"updated_at": "2015-12-13T07:20:04+01:00"
}
}
]
"""
And Mite is setup to connect to this mock server
Then "-c .mite.toml services" should return the following:
"""
id name notes
-- ---- -----
38672 Website Konzeption
"""

0 comments on commit 3402b6b

Please sign in to comment.