Skip to content

Commit

Permalink
Fix test suite for Rack 2.x compatiblity.
Browse files Browse the repository at this point in the history
  • Loading branch information
voxik authored and junaruga committed May 2, 2017
1 parent e1b0d73 commit 3e6fc7c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spec/rack/test/utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
params = Rack::Utils::Multipart.parse_multipart(env)
params = Rack::Multipart.parse_multipart(env)
check expect(params["submit-name"]).to eq("Larry")
check expect(params["files"][:filename]).to eq("foo.txt")
expect(params["files"][:tempfile].read).to eq("bar\n")
Expand All @@ -82,7 +82,7 @@
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
params = Rack::Utils::Multipart.parse_multipart(env)
params = Rack::Multipart.parse_multipart(env)
check expect(params["submit-name"]).to eq("Larry")

check expect(params["files"][0][:filename]).to eq("foo.txt")
Expand All @@ -102,7 +102,7 @@
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
params = Rack::Utils::Multipart.parse_multipart(env)
params = Rack::Multipart.parse_multipart(env)
check expect(params["people"][0]["submit-name"]).to eq("Larry")
check expect(params["people"][0]["files"][:filename]).to eq("foo.txt")
expect(params["people"][0]["files"][:tempfile].read).to eq("bar\n")
Expand All @@ -119,7 +119,7 @@
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
params = Rack::Utils::Multipart.parse_multipart(env)
params = Rack::Multipart.parse_multipart(env)
check expect(params["files"][:filename]).to eq("foo.txt")
expect(params["files"][:tempfile].read).to eq("bar\n")
check expect(params["foo"]).to eq([{"id" => "1", "name" => "Dave"}, {"id" => "2", "name" => "Steve"}])
Expand All @@ -137,7 +137,7 @@
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
params = Rack::Utils::Multipart.parse_multipart(env)
params = Rack::Multipart.parse_multipart(env)
check expect(params["files"][:filename]).to eq("foo.txt")
expect(params["files"][:tempfile].read).to eq("bar\n")
check expect(params["foo"]).to eq({"bar" => [{"id" => "1", "name" => "Dave"},
Expand All @@ -155,7 +155,7 @@
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
params = Rack::Utils::Multipart.parse_multipart(env)
params = Rack::Multipart.parse_multipart(env)
check expect(params["files"][0][:filename]).to eq("foo.txt")
expect(params["files"][0][:tempfile].read).to eq("bar\n")
check expect(params["foo"][0]).to eq("1")
Expand All @@ -173,7 +173,7 @@
:input => StringIO.new(data)
}
env = Rack::MockRequest.env_for("/", options)
params = Rack::Utils::Multipart.parse_multipart(env)
params = Rack::Multipart.parse_multipart(env)
check expect(params["foo"][0]["id"]).to eq("1")
check expect(params["foo"][0]["data"][:filename]).to eq("foo.txt")
expect(params["foo"][0]["data"][:tempfile].read).to eq("bar\n")
Expand Down

0 comments on commit 3e6fc7c

Please sign in to comment.