rest_shifter 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES +4 -0
- data/examples/{200ok.flavor → s200ok.flavor} +0 -0
- data/examples/{200sleep2sec.flavor → s200sleep2sec.flavor} +0 -0
- data/examples/{201created.flavor → s201created.flavor} +0 -0
- data/examples/{202accepted.flavor → s202accepted.flavor} +0 -0
- data/examples/{203nonauthoritativeinformation.flavor → s203nonauthoritativeinformation.flavor} +0 -0
- data/examples/{204noconten.flavor → s204noconten.flavor} +0 -0
- data/examples/{301movedpermanently.flavor → s301movedpermanently.flavor} +0 -0
- data/examples/{302found.flavor → s302found.flavor} +0 -0
- data/examples/{303seeother.flavor → s303seeother.flavor} +0 -0
- data/examples/{307temporaryredirect.flavor → s307temporaryredirect.flavor} +0 -0
- data/examples/{400badrequest.flavor → s400badrequest.flavor} +0 -0
- data/examples/{404notfound.flavor → s404notfound.flavor} +0 -0
- data/examples/{500internalservererror.flavor → s500internalservererror.flavor} +0 -0
- data/lib/rest_shifter/shifter.rb +2 -2
- data/lib/rest_shifter/version.rb +1 -1
- data/spec/flavors/nocontenttype.flavor +9 -0
- data/spec/service_spec.rb +8 -0
- metadata +17 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 476662617503e739954280164153c4fd12fc770f
|
4
|
+
data.tar.gz: 5511050c68f823b7c7c1d8c5147fe4dd2ae95482
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7867cbb9586432a1df44b8e816c59621ea9e8c36876d475cfe5ee5965475d44e2be552c74ee9e17c98286af149f5e503230d2b9126ff10d878115da7e735826
|
7
|
+
data.tar.gz: ecb4a3cb5976440f49824104a5bb24b6e4a17af5041954beee8c5e5836681068431088d46ecf195322e19b02f0767db10cb0317d5412fba7f689ecbdfb71d9af
|
data/CHANGES
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/examples/{203nonauthoritativeinformation.flavor → s203nonauthoritativeinformation.flavor}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rest_shifter/shifter.rb
CHANGED
@@ -50,10 +50,10 @@ class Shifter < Sinatra::Base
|
|
50
50
|
|
51
51
|
build_services {
|
52
52
|
|current, service|
|
53
|
-
current.response['Location'] = service.response_location unless service.response_location.to_s.empty?
|
54
53
|
sleep service.response_sleep
|
54
|
+
current.response['Location'] = service.response_location unless service.response_location.to_s.empty?
|
55
|
+
current.content_type service.response_content_type unless service.response_content_type.to_s.empty?
|
55
56
|
current.status service.response_status
|
56
|
-
current.content_type service.response_content_type
|
57
57
|
service.response_body
|
58
58
|
}
|
59
59
|
end
|
data/lib/rest_shifter/version.rb
CHANGED
data/spec/service_spec.rb
CHANGED
@@ -40,6 +40,14 @@ describe RestShifter do
|
|
40
40
|
expect(last_response.headers['Content-Type']).to eq("application/json")
|
41
41
|
end
|
42
42
|
|
43
|
+
it "GET: No content type defined on response" do
|
44
|
+
get '/nocontenttype'
|
45
|
+
expect(last_response.status).to eq(202)
|
46
|
+
expect(last_response.body).to eq("no content type defined on response")
|
47
|
+
expect(last_response.headers['Content-Type']).to eq("text/html;charset=utf-8")
|
48
|
+
end
|
49
|
+
|
50
|
+
|
43
51
|
end
|
44
52
|
describe "Post operations" do
|
45
53
|
it "POST: Endpoint for post" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_shifter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camilo Ribeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codeclimate-test-reporter
|
@@ -182,19 +182,19 @@ files:
|
|
182
182
|
- README.md
|
183
183
|
- Rakefile
|
184
184
|
- bin/rest_shifter
|
185
|
-
- examples/
|
186
|
-
- examples/
|
187
|
-
- examples/
|
188
|
-
- examples/
|
189
|
-
- examples/
|
190
|
-
- examples/
|
191
|
-
- examples/
|
192
|
-
- examples/
|
193
|
-
- examples/
|
194
|
-
- examples/
|
195
|
-
- examples/
|
196
|
-
- examples/
|
197
|
-
- examples/
|
185
|
+
- examples/s200ok.flavor
|
186
|
+
- examples/s200sleep2sec.flavor
|
187
|
+
- examples/s201created.flavor
|
188
|
+
- examples/s202accepted.flavor
|
189
|
+
- examples/s203nonauthoritativeinformation.flavor
|
190
|
+
- examples/s204noconten.flavor
|
191
|
+
- examples/s301movedpermanently.flavor
|
192
|
+
- examples/s302found.flavor
|
193
|
+
- examples/s303seeother.flavor
|
194
|
+
- examples/s307temporaryredirect.flavor
|
195
|
+
- examples/s400badrequest.flavor
|
196
|
+
- examples/s404notfound.flavor
|
197
|
+
- examples/s500internalservererror.flavor
|
198
198
|
- lib/rest_shifter.rb
|
199
199
|
- lib/rest_shifter/commands.rb
|
200
200
|
- lib/rest_shifter/commands/create.rb
|
@@ -208,6 +208,7 @@ files:
|
|
208
208
|
- rest_shifter.gemspec
|
209
209
|
- spec/flavors/location_get.flavor
|
210
210
|
- spec/flavors/location_post.flavor
|
211
|
+
- spec/flavors/nocontenttype.flavor
|
211
212
|
- spec/flavors/notfound_get.flavor
|
212
213
|
- spec/flavors/notfound_get_accept.flavor
|
213
214
|
- spec/flavors/notfound_post.flavor
|
@@ -247,6 +248,7 @@ summary: Simple Rest Mock service
|
|
247
248
|
test_files:
|
248
249
|
- spec/flavors/location_get.flavor
|
249
250
|
- spec/flavors/location_post.flavor
|
251
|
+
- spec/flavors/nocontenttype.flavor
|
250
252
|
- spec/flavors/notfound_get.flavor
|
251
253
|
- spec/flavors/notfound_get_accept.flavor
|
252
254
|
- spec/flavors/notfound_post.flavor
|