rack-test 0.8.0 → 0.8.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c2c9dca5557f9f1d5894f9379e38e660698a178
4
- data.tar.gz: aabbb52783cc359935090e319d462076cc0ce95c
3
+ metadata.gz: e1ef918ca1ef466e983de48748ac507cde298bce
4
+ data.tar.gz: 5b51e1abc057e78f5e6a2c651c5b2f20ec1b6049
5
5
  SHA512:
6
- metadata.gz: ed423ebaf4bbdb79a77804f3ed9314f88b5b9e97e9a0eeee0d596c43718bac918f62d4cfd8c1adaa72a0e8fce28f093f5bb7bc3268eec5025c6e47b7ce2556b9
7
- data.tar.gz: a4ef34a8cb3e12bc432012444485af04c50c2780ec658ead424c337dbd3ecd3805a957065bb804b2b1dd73d495819094dfb018c0784cd9766a4f1be6110d7815
6
+ metadata.gz: 70ee9fa76cb6d0174fb88169adc3a854aea6d86da94ee058cb64500ee881b9fcfd8e863f55557d286e6c4458ebc0e67189cbeb78cdab877e3d7b4c06d2e8251d
7
+ data.tar.gz: 116d2337e1daa6852b23172766817b5c17864ec95db124fb50b441a5ab65fd32d755b2605cfcbb4832fd8891d28c98e888389cd9b689b4308d08d2909ddb4b55
data/History.md CHANGED
@@ -1,5 +1,15 @@
1
+ ## 0.8.2 / 2017-11-21
2
+
3
+ * Bug fixes:
4
+ * Bugfix for `UploadedFile.new` unintended API breakage.
5
+ (Per Lundberg #210)
6
+
1
7
  ## 0.8.0 / 2017-11-20
2
8
 
9
+ * Known Issue
10
+ * In `UploadedFile.new`, when passing e.g. a `Pathname` object,
11
+ errors can be raised (eg. `ArgumentError: Missing original_filename
12
+ for IO`, or `NoMethodError: undefined method 'size'`) See #207, #209.
3
13
  * Minor enhancements
4
14
  * Add a required_ruby_version of >= 2.2.2, similar to rack 2.0.1.
5
15
  (Samuel Giddins #194)
data/README.md CHANGED
@@ -52,7 +52,7 @@ class HomepageTest < Test::Unit::TestCase
52
52
  end
53
53
 
54
54
  def set_request_headers
55
- headers 'Accept-Charset', 'utf-8'
55
+ header 'Accept-Charset', 'utf-8'
56
56
  get '/'
57
57
 
58
58
  assert last_response.ok?
@@ -1,5 +1,6 @@
1
- require 'tempfile'
2
1
  require 'fileutils'
2
+ require 'pathname'
3
+ require 'tempfile'
3
4
 
4
5
  module Rack
5
6
  module Test
@@ -18,8 +19,16 @@ module Rack
18
19
  # The content type of the "uploaded" file
19
20
  attr_accessor :content_type
20
21
 
22
+ # Creates a new UploadedFile instance.
23
+ #
24
+ # @param content [IO, Pathname, String, StringIO] a path to a file, or an {IO} or {StringIO} object representing the
25
+ # file.
26
+ # @param content_type [String]
27
+ # @param binary [Boolean] an optional flag that indicates whether the file should be open in binary mode or not.
28
+ # @param original_filename [String] an optional parameter that provides the original filename if `content` is an IO
29
+ # object.
21
30
  def initialize(content, content_type = 'text/plain', binary = false, original_filename: nil)
22
- if content.respond_to?(:read)
31
+ if content.respond_to?(:read) && (content.is_a?(IO) || content.is_a?(StringIO))
23
32
  initialize_from_io(content, original_filename)
24
33
  else
25
34
  initialize_from_file_path(content)
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module Test
3
- VERSION = '0.8.0'.freeze
3
+ VERSION = '0.8.2'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Helmkamp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-20 00:00:00.000000000 Z
11
+ date: 2017-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.6.11
184
+ rubygems_version: 2.6.14
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: Simple testing API built on Rack