optimus_prime 1.5.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -2
- data/lib/optimus_prime/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b3135b64d78fbfc82b6e95728b246c98b5f7d4e
|
4
|
+
data.tar.gz: e4e4d81b833d88ae6f5664241e92982fda0d7eea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e8113aaa90279f42911eeaf9b85bdf3dd7b8a71b1b1bed18d5d9f0a818742228288ff7aea4b14f658abcdb70a73dc6d82bf9fa58bd8b17a14df5ff492dab58c
|
7
|
+
data.tar.gz: 4923245beaf1e72e8be3a7528d153ed92c35516cac9e9d840af2d72b717e04e1dd70791c1e201019138ac49be5936967fe1af6ad8505b37c7cc2a5b42ac6153e
|
data/README.md
CHANGED
@@ -26,10 +26,12 @@ to it and get the desired response.
|
|
26
26
|
* localhost:7003 -> TEST default endpoint
|
27
27
|
* returns 200 status code for GET,POST
|
28
28
|
* sets content-type to text
|
29
|
+
* wait_for is 3 seconds
|
29
30
|
|
30
31
|
## HTTP allowed requests
|
31
32
|
* GET
|
32
33
|
* POST
|
34
|
+
* PUT
|
33
35
|
|
34
36
|
# Usage
|
35
37
|
```ruby
|
@@ -127,12 +129,17 @@ By default OptimusPrime sets <code>wait_for</code> flag to 3 seconds.
|
|
127
129
|
# GET Requests
|
128
130
|
op.prime('your/endpoint')
|
129
131
|
Faraday.get("http://localhost:7002/get/your/endpoint")
|
130
|
-
op.
|
132
|
+
op.last_request_for('your/endpoint') #=> ["method" => "GET", "body" => ""]
|
131
133
|
|
132
134
|
# POST Requests
|
133
135
|
op.prime('your/endpoint')
|
134
136
|
Faraday.post("http://localhost:7002/get/your/endpoint", {some: "data"})
|
135
|
-
op.
|
137
|
+
op.last_request_for('your/endpoint') #=> ["method" => "GET", "body" => "some=data", "headers" => { "content_type": "", accept: [] } ]
|
138
|
+
```
|
139
|
+
|
140
|
+
## Clear all requests
|
141
|
+
```ruby
|
142
|
+
op.clear
|
136
143
|
```
|
137
144
|
|
138
145
|
## TODO
|