rack-test 0.6.3 → 0.8.3

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.
metadata CHANGED
@@ -1,56 +1,158 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
5
- prerelease:
4
+ version: 0.8.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Bryan Helmkamp
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2015-01-09 00:00:00.000000000 Z
11
+ date: 2018-02-27 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3'
22
23
  type: :runtime
23
24
  prerelease: false
24
25
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.0'
30
- description: ! 'Rack::Test is a small, simple testing API for Rack apps. It can be
31
- used on its
32
-
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rake
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '12.0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '12.0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rspec
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.6'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.6'
61
+ - !ruby/object:Gem::Dependency
62
+ name: sinatra
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '1.0'
68
+ - - "<"
69
+ - !ruby/object:Gem::Version
70
+ version: '3'
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '1.0'
78
+ - - "<"
79
+ - !ruby/object:Gem::Version
80
+ version: '3'
81
+ - !ruby/object:Gem::Dependency
82
+ name: rdoc
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '5.1'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '5.1'
95
+ - !ruby/object:Gem::Dependency
96
+ name: rubocop
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0.49'
102
+ - - "<"
103
+ - !ruby/object:Gem::Version
104
+ version: '0.50'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0.49'
112
+ - - "<"
113
+ - !ruby/object:Gem::Version
114
+ version: '0.50'
115
+ - !ruby/object:Gem::Dependency
116
+ name: codeclimate-test-reporter
117
+ requirement: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '0.6'
122
+ type: :development
123
+ prerelease: false
124
+ version_requirements: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - "~>"
127
+ - !ruby/object:Gem::Version
128
+ version: '0.6'
129
+ - !ruby/object:Gem::Dependency
130
+ name: thor
131
+ requirement: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - "~>"
134
+ - !ruby/object:Gem::Version
135
+ version: '0.19'
136
+ type: :development
137
+ prerelease: false
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: '0.19'
143
+ description: |-
144
+ Rack::Test is a small, simple testing API for Rack apps. It can be used on its
33
145
  own or as a reusable starting point for Web frameworks and testing libraries
34
-
35
- to build on. Most of its initial functionality is an extraction of Merb 1.0''s
36
-
37
- request helpers feature.'
146
+ to build on. Most of its initial functionality is an extraction of Merb 1.0's
147
+ request helpers feature.
38
148
  email: bryan@brynary.com
39
149
  executables: []
40
150
  extensions: []
41
- extra_rdoc_files:
42
- - README.rdoc
43
- - MIT-LICENSE.txt
151
+ extra_rdoc_files: []
44
152
  files:
45
- - .document
46
- - .gitignore
47
- - Gemfile
48
- - Gemfile.lock
49
- - History.txt
153
+ - History.md
50
154
  - MIT-LICENSE.txt
51
- - README.rdoc
52
- - Rakefile
53
- - Thorfile
155
+ - README.md
54
156
  - lib/rack/mock_session.rb
55
157
  - lib/rack/test.rb
56
158
  - lib/rack/test/cookie_jar.rb
@@ -58,52 +160,29 @@ files:
58
160
  - lib/rack/test/mock_digest_request.rb
59
161
  - lib/rack/test/uploaded_file.rb
60
162
  - lib/rack/test/utils.rb
61
- - rack-test.gemspec
62
- - spec/fixtures/bar.txt
63
- - spec/fixtures/config.ru
64
- - spec/fixtures/fake_app.rb
65
- - spec/fixtures/foo.txt
66
- - spec/rack/test/cookie_spec.rb
67
- - spec/rack/test/digest_auth_spec.rb
68
- - spec/rack/test/multipart_spec.rb
69
- - spec/rack/test/uploaded_file_spec.rb
70
- - spec/rack/test/utils_spec.rb
71
- - spec/rack/test_spec.rb
72
- - spec/spec_helper.rb
73
- - spec/support/matchers/body.rb
74
- - spec/support/matchers/challenge.rb
75
- homepage: http://github.com/brynary/rack-test
76
- licenses: []
163
+ - lib/rack/test/version.rb
164
+ homepage: http://github.com/rack-test/rack-test
165
+ licenses:
166
+ - MIT
167
+ metadata: {}
77
168
  post_install_message:
78
169
  rdoc_options: []
79
170
  require_paths:
80
171
  - lib
81
172
  required_ruby_version: !ruby/object:Gem::Requirement
82
- none: false
83
173
  requirements:
84
- - - ! '>='
174
+ - - ">="
85
175
  - !ruby/object:Gem::Version
86
- version: '0'
176
+ version: 2.2.2
87
177
  required_rubygems_version: !ruby/object:Gem::Requirement
88
- none: false
89
178
  requirements:
90
- - - ! '>='
179
+ - - ">="
91
180
  - !ruby/object:Gem::Version
92
181
  version: '0'
93
182
  requirements: []
94
- rubyforge_project: rack-test
95
- rubygems_version: 1.8.23.2
183
+ rubyforge_project:
184
+ rubygems_version: 2.7.6
96
185
  signing_key:
97
- specification_version: 3
186
+ specification_version: 4
98
187
  summary: Simple testing API built on Rack
99
- test_files:
100
- - spec/fixtures/fake_app.rb
101
- - spec/rack/test/cookie_spec.rb
102
- - spec/rack/test/digest_auth_spec.rb
103
- - spec/rack/test/multipart_spec.rb
104
- - spec/rack/test/uploaded_file_spec.rb
105
- - spec/rack/test/utils_spec.rb
106
- - spec/rack/test_spec.rb
107
- - spec/spec_helper.rb
108
- - spec/support/matchers/body.rb
109
- - spec/support/matchers/challenge.rb
188
+ test_files: []
data/.document DELETED
@@ -1,4 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- History.txt
4
- MIT-LICENSE.txt
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- pkg
2
- doc
3
- coverage
4
- VERSION
5
- *.rbc
6
- .bundle
data/Gemfile DELETED
@@ -1,8 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rspec'
4
- gem "rack"
5
- gem "sinatra"
6
- gem 'rake'
7
-
8
- gem "codeclimate-test-reporter", group: :test, require: nil
data/Gemfile.lock DELETED
@@ -1,41 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- codeclimate-test-reporter (0.3.0)
5
- simplecov (>= 0.7.1, < 1.0.0)
6
- diff-lcs (1.2.3)
7
- docile (1.1.3)
8
- multi_json (1.9.0)
9
- rack (1.5.2)
10
- rack-protection (1.5.0)
11
- rack
12
- rake (10.0.4)
13
- rspec (2.13.0)
14
- rspec-core (~> 2.13.0)
15
- rspec-expectations (~> 2.13.0)
16
- rspec-mocks (~> 2.13.0)
17
- rspec-core (2.13.1)
18
- rspec-expectations (2.13.0)
19
- diff-lcs (>= 1.1.3, < 2.0)
20
- rspec-mocks (2.13.1)
21
- simplecov (0.8.2)
22
- docile (~> 1.1.0)
23
- multi_json
24
- simplecov-html (~> 0.8.0)
25
- simplecov-html (0.8.0)
26
- sinatra (1.4.2)
27
- rack (~> 1.5, >= 1.5.2)
28
- rack-protection (~> 1.4)
29
- tilt (~> 1.3, >= 1.3.4)
30
- tilt (1.3.7)
31
-
32
- PLATFORMS
33
- java
34
- ruby
35
-
36
- DEPENDENCIES
37
- codeclimate-test-reporter
38
- rack
39
- rake
40
- rspec
41
- sinatra
data/History.txt DELETED
@@ -1,179 +0,0 @@
1
- == 0.6.3 / 2015-01-09
2
-
3
- * Minor enhancements
4
-
5
- * Expose an env helper for persistently configuring the env as needed
6
- (Darío Javier Cravero #80)
7
- * Expose the tempfile of UploadedFile (Sytse Sijbrandij #67)
8
-
9
- * Bug fixes
10
-
11
- * Improve support for arrays of hashes in multipart forms (Murray Steele #69)
12
- * Improve test for query strings (Paul Grayson #66)
13
-
14
- == 0.6.2 / 2012-09-27
15
-
16
- * Minor enhancements
17
-
18
- * Support HTTP PATCH method (Marjan Krekoten' #33)
19
- * Preserve the exact query string when possible (Paul Grayson #63)
20
- * Add a #delete method to CookieJar (Paul Grayson #63)
21
-
22
- * Bug fixes
23
-
24
- * Fix HTTP Digest authentication when the URI has query params
25
- * Don't append default ports to HTTP_HOST (David Lee #57)
26
-
27
- == 0.6.1 / 2011-07-27
28
-
29
- * Bug fixes
30
-
31
- * Fix support for params with arrays in multipart forms (Joel Chippindale)
32
- * Add respond_to? to Rack::Test::UploadedFile to match method_missing (Josh Nichols)
33
- * Set the Referer header on requests issued by follow_redirect! (Ryan Bigg)
34
-
35
- == 0.6.0 / 2011-05-03
36
-
37
- * Bug fixes
38
-
39
- * Add support for HTTP OPTIONS verb (Paolo "Nusco" Perrotta)
40
- * Call #finish on MockResponses if it's available (Aaron Patterson)
41
- * Allow HTTP_HOST to be set via #header (Geoff Buesing)
42
-
43
- == 0.5.7 / 2011-01-01
44
-
45
- * Bug fixes
46
-
47
- * If no URI is present, include all cookies (Pratik Naik)
48
-
49
- == 0.5.6 / 2010-09-25
50
-
51
- * Bug fixes
52
-
53
- * Use parse_nested_query for parsing URI like Rack does (Eugene Bolshakov)
54
- * Don't depend on ActiveSupport extension to String (Bryan Helmkamp)
55
- * Do not overwrite HTTP_HOST if it is set (Krekoten' Marjan)
56
-
57
- == 0.5.5 / 2010-09-22
58
-
59
- * Bug fixes
60
-
61
- * Fix encoding of file uploads on Ruby 1.9 (Alan Kennedy)
62
- * Set env["HTTP_HOST"] when making requests (Istvan Hoka)
63
-
64
- == 0.5.4 / 2010-05-26
65
-
66
- * Bug fixes
67
-
68
- * Don't stomp on Content-Type's supplied via #header (Bryan Helmkamp)
69
- * Fixed build_multipart to allow for arrays of files (Louis Rose)
70
- * Don't raise an error if raw cookies contain a blank line (John Reilly)
71
- * Handle parameter names with brackets properly (Tanner Donovan)
72
-
73
- == 0.5.3 / 2009-11-27
74
-
75
- * Bug fixes
76
-
77
- * Fix cookie matching for subdomains (Marcin Kulik)
78
-
79
- == 0.5.2 / 2009-11-13
80
-
81
- * Bug fixes
82
-
83
- * Call close on response body after iteration, not before (Simon Rozet)
84
- * Add missing require for time in cookie_jar.rb (Jerry West)
85
-
86
- == 0.5.1 / 2009-10-27
87
-
88
- * Bug fixes
89
-
90
- * Escape cookie values (John Pignata)
91
- * Close the response body after each request, as per the Rack spec (Elomar França)
92
-
93
- == 0.5.0 / 2009-09-19
94
-
95
- * Bug fixes
96
-
97
- * Set HTTP_X_REQUESTED_WITH in the Rack env when a request is made with :xhr => true (Ben Sales)
98
- * Set headers in the Rack env in HTTP_USER_AGENT form
99
- * Rack::Test now generates no Ruby warnings
100
-
101
- == 0.4.2 / 2009-09-01
102
-
103
- * Minor enhancements
104
-
105
- * Merge in rack/master's build_multipart method which covers additional cases
106
- * Accept raw :params string input and merge it with the query string
107
- * Stringify and upcase request method (e.g. :post => "POST") (Josh Peek)
108
-
109
- * Bug fixes
110
-
111
- * Properly convert hashes with nil values (e.g. :foo => nil becomes simply "foo", not "foo=")
112
- * Prepend a slash to the URI path if it doesn't start with one (Josh Peek)
113
- * Requiring Rack-Test never modifies the Ruby load path anymore (Josh Peek)
114
- * Fixed using multiple cookies in a string on Ruby 1.8 (Tuomas Kareinen and Hermanni Hyytiälä)
115
-
116
- == 0.4.1 / 2009-08-06
117
-
118
- * Minor enhancements
119
-
120
- * Support initializing a Rack::Test::Session with an app in addition to
121
- a Rack::MockSession
122
- * Allow CONTENT_TYPE to be specified in the env and not overwritten when
123
- sending a POST or PUT
124
-
125
- == 0.4.0 / 2009-06-25
126
-
127
- * Minor enhancements
128
-
129
- * Expose hook for building Rack::MockSessions for frameworks that need
130
- to configure them before use
131
- * Support passing in arrays of raw cookies in addition to a newline
132
- separated string
133
- * Support after_request callbacks in MockSession for things like running
134
- background jobs
135
- * Allow multiple named sessions using with_session
136
- * Initialize Rack::Test::Sessions with Rack::MockSessions instead of apps.
137
- This change should help integration with other Ruby web frameworks
138
- (like Merb).
139
- * Support sending bodies for PUT requests (Larry Diehl)
140
-
141
- == 0.3.0 / 2009-05-17
142
-
143
- * Major enhancements
144
-
145
- * Ruby 1.9 compatible (Simon Rozet, Michael Fellinger)
146
-
147
- * Minor enhancements
148
-
149
- * Add CookieJar#[] and CookieJar#[]= methods
150
- * Make the default host configurable
151
- * Use Rack::Lint and fix errors (Simon Rozet)
152
- * Extract Rack::MockSession from Rack::Test::Session to handle tracking
153
- the last request and response and the cookie jar
154
- * Add #set_cookie and #clear_cookies methods
155
- * Rename #authorize to #basic_authorize (#authorize remains as an alias)
156
- (Simon Rozet)
157
-
158
- == 0.2.0 / 2009-04-26
159
-
160
- Because #last_response is now a MockResponse instead of a Rack::Response,
161
- #last_response.body now returns a string instead of an array.
162
-
163
- * Major enhancements
164
-
165
- * Support multipart requests via the UploadedFile class (thanks, Rails)
166
-
167
- * Minor enhancements
168
-
169
- * Updated for Rack 1.0
170
- * Don't require rubygems (See http://gist.github.com/54177)
171
- * Support HTTP Digest authentication with the #digest_authorize method
172
- * #last_response returns a MockResponse instead of a Response
173
- (Michael Fellinger)
174
-
175
- == 0.1.0 / 2009-03-02
176
-
177
- * 1 major enhancement
178
-
179
- * Birthday!
data/README.rdoc DELETED
@@ -1,85 +0,0 @@
1
- = Rack::Test {<img src="https://codeclimate.com/github/brynary/rack-test.png" />}[https://codeclimate.com/github/brynary/rack-test] {<img src="https://codeclimate.com/github/brynary/rack-test/coverage.png" />}[https://codeclimate.com/github/brynary/rack-test]
2
-
3
- - Code: http://github.com/brynary/rack-test
4
-
5
- == Description
6
-
7
- Rack::Test is a small, simple testing API for Rack apps. It can be used on its
8
- own or as a reusable starting point for Web frameworks and testing libraries
9
- to build on. Most of its initial functionality is an extraction of Merb 1.0's
10
- request helpers feature.
11
-
12
- == Features
13
-
14
- * Maintains a cookie jar across requests
15
- * Easily follow redirects when desired
16
- * Set request headers to be used by all subsequent requests
17
- * Small footprint. Approximately 200 LOC
18
-
19
- == Examples
20
-
21
- require "rack/test"
22
-
23
- class HomepageTest < Test::Unit::TestCase
24
- include Rack::Test::Methods
25
-
26
- def app
27
- MyApp.new
28
- end
29
-
30
- def test_redirect_logged_in_users_to_dashboard
31
- authorize "bryan", "secret"
32
- get "/"
33
- follow_redirect!
34
-
35
- assert_equal "http://example.org/redirected", last_request.url
36
- assert last_response.ok?
37
- end
38
-
39
- end
40
-
41
-
42
- If you want to test one app in isolation, you just return that app as shown above. But if you want to test the entire app stack, including middlewares, cascades etc. you need to parse the app defined in config.ru.
43
-
44
- OUTER_APP = Rack::Builder.parse_file('config.ru').first
45
-
46
- class TestApp < Test::Unit::TestCase
47
- include Rack::Test::Methods
48
-
49
- def app
50
- OUTER_APP
51
- end
52
-
53
- def test_root
54
- get '/'
55
- assert last_response.ok?
56
- end
57
- end
58
-
59
-
60
- == Install
61
-
62
- To install the latest release as a gem:
63
-
64
- sudo gem install rack-test
65
-
66
- Or via Bundler:
67
-
68
- gem "rack-test", require: "rack/test"
69
-
70
- == Authors
71
-
72
- - Maintained by {Bryan Helmkamp}[mailto:bryan@brynary.com]
73
- - Contributions from Simon Rozet, Pat Nakajima and others
74
- - Much of the original code was extracted from Merb 1.0's request helper
75
-
76
- == License
77
-
78
- Copyright (c) 2008-2009 Bryan Helmkamp, Engine Yard Inc.
79
- See MIT-LICENSE.txt in this directory.
80
-
81
- == Releasing
82
-
83
- * Ensure History.txt is up-to-date
84
- * Bump VERSION in lib/rack/test.rb
85
- * thor :release
data/Rakefile DELETED
@@ -1,33 +0,0 @@
1
- require "rubygems"
2
-
3
-
4
- require 'rspec/core'
5
- require "rspec/core/rake_task"
6
-
7
- RSpec::Core::RakeTask.new do |t|
8
- t.pattern = "./**/*_spec.rb"
9
- t.ruby_opts = "-w"
10
- end
11
-
12
- task :default => :spec
13
-
14
- # desc "Run all specs in spec directory with RCov"
15
- # RSpec::Core::RakeTask.new(:rcov) do |t|
16
- # t.libs << 'lib'
17
- # t.libs << 'spec'
18
- # t.warning = true
19
- # t.rcov = true
20
- # t.rcov_opts = ['-x spec']
21
- # end
22
-
23
- desc "Generate RDoc"
24
- task :docs do
25
- FileUtils.rm_rf("doc")
26
- require "rack/test"
27
- system "hanna --title 'Rack::Test #{Rack::Test::VERSION} API Documentation'"
28
- end
29
-
30
- desc 'Removes trailing whitespace'
31
- task :whitespace do
32
- sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
33
- end