webmachine-test 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,3 @@
1
- require 'stringio'
2
1
  require 'uri'
3
2
 
4
3
  # Ruby 1.8 does not have URI.encode_www_form_component.
@@ -36,7 +35,7 @@ module Webmachine
36
35
 
37
36
  # Set the request body.
38
37
  def body(value)
39
- @body = value.respond_to?(:read) ? value : StringIO.new(value.to_s)
38
+ @body = value
40
39
  end
41
40
 
42
41
  HTTP_METHODS.each do |method|
@@ -66,7 +65,7 @@ module Webmachine
66
65
  options[:headers] ||= {}
67
66
  options[:headers].each { |k, v| @headers[k] = v }
68
67
 
69
- @body ||= options[:body] || StringIO.new
68
+ @body ||= options[:body]
70
69
 
71
70
  @req = Webmachine::Request.new(method, uri, @headers, @body)
72
71
  @res = Webmachine::Response.new
@@ -1,5 +1,5 @@
1
1
  module Webmachine
2
2
  module Test
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -126,20 +126,15 @@ describe Webmachine::Test::Session do
126
126
  end
127
127
 
128
128
  describe "#body" do
129
- context "given a string" do
130
- it "sets the body" do
131
- body('test body')
132
- get '/'
133
- request.body.read.should == 'test body'
134
- end
129
+ it "sets the body" do
130
+ body('test body')
131
+ get '/'
132
+ request.body.should == 'test body'
135
133
  end
136
134
 
137
- context "given an IO object" do
138
- it "sets the body" do
139
- body(StringIO.new('foo'))
140
- get '/'
141
- request.body.read.should == 'foo'
142
- end
135
+ it "defaults to a nil body" do
136
+ get '/'
137
+ request.body.should be_nil
143
138
  end
144
139
  end
145
140
  end
metadata CHANGED
@@ -1,46 +1,40 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: webmachine-test
3
- version: !ruby/object:Gem::Version
4
- hash: 25
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Bernd Ahlers
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-07-08 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-08-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: webmachine
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
32
22
  type: :runtime
33
- version_requirements: *id001
34
- description: " Webmachine::Test provides a testing API for webmachine-ruby inspired by rack-test. "
35
- email:
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: ! ' Webmachine::Test provides a testing API for webmachine-ruby inspired
31
+ by rack-test. '
32
+ email:
36
33
  - bernd@tuneafish.de
37
34
  executables: []
38
-
39
35
  extensions: []
40
-
41
36
  extra_rdoc_files: []
42
-
43
- files:
37
+ files:
44
38
  - Gemfile
45
39
  - README.md
46
40
  - Rakefile
@@ -52,38 +46,34 @@ files:
52
46
  - spec/spec_helper.rb
53
47
  - spec/webmachine/test/session_spec.rb
54
48
  - webmachine-test.gemspec
55
- homepage: ""
49
+ homepage: ''
56
50
  licenses: []
57
-
58
51
  post_install_message:
59
52
  rdoc_options: []
60
-
61
- require_paths:
53
+ require_paths:
62
54
  - lib
63
- required_ruby_version: !ruby/object:Gem::Requirement
55
+ required_ruby_version: !ruby/object:Gem::Requirement
64
56
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 3
69
- segments:
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ segments:
70
62
  - 0
71
- version: "0"
72
- required_rubygems_version: !ruby/object:Gem::Requirement
63
+ hash: -2796034837073697484
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
65
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ segments:
79
71
  - 0
80
- version: "0"
72
+ hash: -2796034837073697484
81
73
  requirements: []
82
-
83
74
  rubyforge_project: webmachine-test
84
- rubygems_version: 1.8.10
75
+ rubygems_version: 1.8.24
85
76
  signing_key:
86
77
  specification_version: 3
87
78
  summary: Test API for webmachine-ruby
88
79
  test_files: []
89
-