rest-assured 0.2.0.rc2 → 0.2.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,10 +5,9 @@ class Response
5
5
  if d = Double.where(:fullpath => request.fullpath, :active => true, :verb => request.request_method).first
6
6
  request.body.rewind
7
7
  body = request.body.read #without temp variable ':body = > body' is always nil. mistery
8
- env = request.env #without temp variable either env or params crap out with 'IOError: not opened for reading' on .to_json
9
- params = request.params
8
+ env = request.env.except('rack.input', 'rack.errors')
10
9
 
11
- d.requests.create!(:rack_env => env.to_json, :body => body, :params => params.to_json)
10
+ d.requests.create!(:rack_env => env.to_json, :body => body, :params => request.params.to_json)
12
11
 
13
12
  app.body d.content
14
13
  elsif r = Redirect.ordered.find { |r| request.fullpath =~ /#{r.pattern}/ }
@@ -1,3 +1,3 @@
1
1
  module RestAssured
2
- VERSION = '0.2.0.rc2'
2
+ VERSION = '0.2.0.rc3'
3
3
  end
@@ -10,11 +10,12 @@ describe Response do
10
10
  end
11
11
  end
12
12
 
13
+ let(:env) { stub(:to_json => 'env').as_null_object }
13
14
  let(:request) {
14
15
  double('Request',
15
16
  :request_method => 'GET',
16
17
  :fullpath => '/api',
17
- :env => stub(:to_json => 'env'),
18
+ :env => env,
18
19
  :body => stub(:read => 'body').as_null_object,
19
20
  :params => stub(:to_json => 'params')
20
21
  )
@@ -53,4 +54,14 @@ describe Response do
53
54
 
54
55
  Response.perform(rest_assured_app)
55
56
  end
57
+
58
+ it 'excludes "rack.input" and "rack.errors" as they break with "IOError - not opened for reading:" on consequent #to_json (as they are IO and StringIO)' do
59
+ requests = double.as_null_object
60
+ Double.stub_chain('where.first').and_return(double(:requests => requests).as_null_object)
61
+
62
+ env.should_receive(:except).with('rack.input', 'rack.errors')
63
+
64
+ Response.perform(rest_assured_app)
65
+ end
66
+
56
67
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-assured
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424049
4
+ hash: 15424051
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
9
  - 0
10
10
  - rc
11
- - 2
12
- version: 0.2.0.rc2
11
+ - 3
12
+ version: 0.2.0.rc3
13
13
  platform: ruby
14
14
  authors:
15
15
  - Artem Avetisyan
@@ -17,8 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-10-19 00:00:00 +01:00
21
- default_executable:
20
+ date: 2011-10-20 00:00:00 Z
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
24
23
  name: sinatra
@@ -222,7 +221,6 @@ files:
222
221
  - views/redirects/edit.haml
223
222
  - views/redirects/index.haml
224
223
  - views/redirects/new.haml
225
- has_rdoc: true
226
224
  homepage: https://github.com/BBC/rest-assured
227
225
  licenses: []
228
226
 
@@ -256,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
254
  requirements: []
257
255
 
258
256
  rubyforge_project: rest-assured
259
- rubygems_version: 1.6.2
257
+ rubygems_version: 1.8.6
260
258
  signing_key:
261
259
  specification_version: 3
262
260
  summary: A tool for high level mocking/stubbing HTTP based REST services