Skip to content

Commit f88c8f3

Browse files
authored
Merge refactor pull request
2 parents c5ea1b4 + a9252ab commit f88c8f3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The latest version is available as a Docker image at [edaddario/erised](https://
2929
docker run --rm -p 8080:8080 edaddario/erised
3030
```
3131

32-
HTTP methods (e.g. GET, POST, PATCH, etc.), query strings and body are **ignored**. URL Paths are also ignored, except for:
32+
HTTP methods (e.g. GET, POST, PATCH, etc.), query strings and body are **ignored**. URL routes are also ignored, except for:
3333

3434
|Name|Purpose|
3535
|--|--|
@@ -89,11 +89,12 @@ NetworkAuthenticationRequired or 511
8989
Any other value will resolve to 200 (OK)
9090

9191
# Release History
92-
* v0.3.0 - Add unit tests
92+
* v0.3.4 - Add [gomega](https://onsi.github.io/gomega/) assertion library, refactor tests to use Ω assertions and minor bug fixes
93+
* v0.3.0 - Add [goblin](https://github.com/franela/goblin) framework and unit tests
9394
* v0.2.5 - Switch to zerolog logging framework, add erised/shutdown path
9495
* v0.2.2 - Add custom headers, add dockerfile
9596
* v0.2.1 - Add gzip compression, improve erised/headers json handling
96-
* v0.0.3 - Add erised/headers, erised/ip and erised/info paths. Add delayed responses
97+
* v0.0.3 - Add erised/headers, erised/ip and erised/info routes. Add delayed responses
9798
* v0.0.2 - Add HTTP redirection status codes (300's), startup configuration parameters and request's logging
9899
* v0.0.1 - Initial release
99100

@@ -106,7 +107,7 @@ Of all of its deficiencies, the most notable is:
106107
I may or may not address this in a future release. Caveat Emptor
107108

108109
# Motivation
109-
When developing and testing REST based API clients, sooner or later I'd come across situations where I needed a quick and easy way to dynamically test endpoint's responses under different scenarios. Although there are many excellent frameworks and mock servers available, the time and effort required to configure them is sometimes not justified, specially if the application under test provides 10's or 100's of paths, so after some brief and unsuccessful googling I decided to create my own.
110+
When developing and testing REST based API clients, sooner or later I'd come across situations where I needed a quick and easy way to dynamically test endpoint's responses under different scenarios. Although there are many excellent frameworks and mock servers available, the time and effort required to configure them is sometimes not justified, specially if the application under test provides 10's or 100's of routes, so after some brief and unsuccessful googling I decided to create my own.
110111

111112
**erised** was inspired somewhat by [Kenneth Reitz's](https://kennethreitz.org/) HTTP Request & Response Service [httpbin.io](https://httpbin.org/) and it may offer similar functionality in future releases.
112113

cmd/erised/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/rs/zerolog/log"
1414
)
1515

16-
const version = "v0.3.3"
16+
const version = "v0.3.4"
1717

1818
type server struct {
1919
mux *http.ServeMux

cmd/erised/serverRoutes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func TestErisedLandingRoute(t *testing.T) {
183183
Ω(res.Header().Get("X-Headers-Two")).Should(Equal("I'm header two"))
184184
})
185185

186-
g.It("Should wait 2000ms", func() {
186+
g.It("Should wait about 2000ms (±10ms)", func() {
187187
res := httptest.NewRecorder()
188188
req := httptest.NewRequest(http.MethodGet, "http://localhost:8080/", nil)
189189
req.Header.Set("X-Erised-Response-Delay", "2000")

0 commit comments

Comments
 (0)