Fix test suite for Rack 2.x compatibilty.

f38
Vít Ondruch 8 years ago
parent 390f424c4e
commit e308e35ddd

@ -0,0 +1,79 @@
From d3e32e0ef2539a6e6c79022ee63807317074fb4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Fri, 2 Sep 2016 12:25:29 +0200
Subject: [PATCH] Fix test suite for Rack 2.x compatiblity.
---
spec/rack/test/utils_spec.rb | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/spec/rack/test/utils_spec.rb b/spec/rack/test/utils_spec.rb
index 3b27767..4557c5b 100644
--- a/spec/rack/test/utils_spec.rb
+++ b/spec/rack/test/utils_spec.rb
@@ -61,7 +61,7 @@ describe Rack::Test::Utils do
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
- params = Rack::Utils::Multipart.parse_multipart(env)
+ params = Rack::Multipart.parse_multipart(env)
check params["submit-name"].should == "Larry"
check params["files"][:filename].should == "foo.txt"
params["files"][:tempfile].read.should == "bar\n"
@@ -77,7 +77,7 @@ describe Rack::Test::Utils do
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
- params = Rack::Utils::Multipart.parse_multipart(env)
+ params = Rack::Multipart.parse_multipart(env)
check params["submit-name"].should == "Larry"
check params["files"][0][:filename].should == "foo.txt"
@@ -97,7 +97,7 @@ describe Rack::Test::Utils do
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
- params = Rack::Utils::Multipart.parse_multipart(env)
+ params = Rack::Multipart.parse_multipart(env)
check params["people"][0]["submit-name"].should == "Larry"
check params["people"][0]["files"][:filename].should == "foo.txt"
params["people"][0]["files"][:tempfile].read.should == "bar\n"
@@ -114,7 +114,7 @@ describe Rack::Test::Utils do
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
- params = Rack::Utils::Multipart.parse_multipart(env)
+ params = Rack::Multipart.parse_multipart(env)
check params["files"][:filename].should == "foo.txt"
params["files"][:tempfile].read.should == "bar\n"
check params["foo"].should == [{"id" => "1", "name" => "Dave"}, {"id" => "2", "name" => "Steve"}]
@@ -132,7 +132,7 @@ describe Rack::Test::Utils do
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
- params = Rack::Utils::Multipart.parse_multipart(env)
+ params = Rack::Multipart.parse_multipart(env)
check params["files"][:filename].should == "foo.txt"
params["files"][:tempfile].read.should == "bar\n"
check params["foo"].should == {"bar" => [{"id" => "1", "name" => "Dave"},
@@ -150,7 +150,7 @@ describe Rack::Test::Utils do
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
- params = Rack::Utils::Multipart.parse_multipart(env)
+ params = Rack::Multipart.parse_multipart(env)
check params["files"][0][:filename].should == "foo.txt"
params["files"][0][:tempfile].read.should == "bar\n"
check params["foo"][0].should == "1"
@@ -168,7 +168,7 @@ describe Rack::Test::Utils do
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
- params = Rack::Utils::Multipart.parse_multipart(env)
+ params = Rack::Multipart.parse_multipart(env)
check params["foo"][0]["id"].should == "1"
check params["foo"][0]["data"][:filename].should == "foo.txt"
params["foo"][0]["data"][:tempfile].read.should == "bar\n"
--
2.9.3

@ -3,11 +3,14 @@
Summary: Simple testing API built on Rack
Name: rubygem-%{gem_name}
Version: 0.6.3
Release: 3%{?dist}
Release: 4%{?dist}
Group: Development/Languages
License: MIT
URL: http://gitrdoc.com/brynary/rack-test/tree/master
Source0: http://gems.rubyforge.org/gems/%{gem_name}-%{version}.gem
# Fix test errors caused by Rack 2.x changes.
# https://github.com/brynary/rack-test/pull/148
Patch0: rubygem-rack-test-0.6.3-Fix-test-suite-for-Rack-2.x-compatiblity.patch
BuildRequires: rubygems-devel
BuildRequires: rubygem(rack) >= 1.0.0
BuildRequires: rubygem(rspec) < 3
@ -34,6 +37,10 @@ Documentation for %{name}
%setup -q -c -T
%gem_install -n %{SOURCE0}
pushd .%{gem_instdir}
%patch0 -p1
popd
%build
@ -75,6 +82,9 @@ popd
%changelog
* Fri Sep 02 2016 Vít Ondruch <vondruch@redhat.com> - 0.6.3-4
- Fix test suite for Rack 2.x compatibilty.
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

Loading…
Cancel
Save