fredo 0.1.8 → 0.1.9

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.9
data/fredo.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fredo}
8
- s.version = "0.1.8"
8
+ s.version = "0.1.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["ilpoldo"]
12
- s.date = %q{2010-05-02}
12
+ s.date = %q{2010-05-04}
13
13
  s.description = %q{Mocks web services by plugging Net::Http straight into Rack}
14
14
  s.email = %q{ilpoldo@gmail.com}
15
15
  s.extra_rdoc_files = [
data/lib/fredo/handler.rb CHANGED
@@ -54,6 +54,8 @@ module Fredo
54
54
  :method => @request.request_method,
55
55
  :host => @request.host,
56
56
  :body => @request.body.read}
57
+ @request.body.rewind
58
+
57
59
  perform!(&block)
58
60
  return
59
61
  end
data/spec/fredo_spec.rb CHANGED
@@ -116,5 +116,18 @@ describe Fredo do
116
116
  response.read.should include('Everything google!')
117
117
 
118
118
  end
119
+
120
+ it "allows access to the request body" do
121
+
122
+ body = 'some gossip'
123
+
124
+ Fredo.post 'http://www.gossip.com' do
125
+ "I heard #{request.body.read}"
126
+ end
127
+
128
+ http = Net::HTTP.new('www.gossip.com')
129
+ http.post('/', body, 'content-type' => 'text/plain').body.should eql(body)
130
+ end
131
+
119
132
  end
120
133
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 8
9
- version: 0.1.8
8
+ - 9
9
+ version: 0.1.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - ilpoldo
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-02 00:00:00 +01:00
17
+ date: 2010-05-04 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency