summaryrefslogtreecommitdiff
path: root/spec/support/shared/functional/http.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-08-17 12:15:26 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-08-17 13:25:02 -0700
commita0c32511bc6634538374ca4b433032b8acd05f96 (patch)
tree15c7cfbd0d773488ab814e7c24f0c58505c9134b /spec/support/shared/functional/http.rb
parent3d0379a2ad531a0b3db5ed2827bf30ef07b26100 (diff)
downloadchef-a0c32511bc6634538374ca4b433032b8acd05f96.tar.gz
fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgrade
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/support/shared/functional/http.rb')
-rw-r--r--spec/support/shared/functional/http.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/support/shared/functional/http.rb b/spec/support/shared/functional/http.rb
index 7e9e3f34c5..76faaaed47 100644
--- a/spec/support/shared/functional/http.rb
+++ b/spec/support/shared/functional/http.rb
@@ -52,27 +52,27 @@ module ChefHTTPShared
# just a normal file
# (expected_content should be uncompressed)
- @api.get("/nyan_cat.png", 200) {
+ @api.get("/nyan_cat.png", 200) do
File.open(nyan_uncompressed_filename, "rb") do |f|
f.read
end
- }
+ end
# this ends in .gz, we do not uncompress it and drop it on the filesystem as a .gz file (the internet often lies)
# (expected_content should be compressed)
- @api.get("/nyan_cat.png.gz", 200, nil, { "Content-Type" => "application/gzip", "Content-Encoding" => "gzip" } ) {
+ @api.get("/nyan_cat.png.gz", 200, nil, { "Content-Type" => "application/gzip", "Content-Encoding" => "gzip" } ) do
File.open(nyan_compressed_filename, "rb") do |f|
f.read
end
- }
+ end
# this is an uncompressed file that was compressed by some mod_gzip-ish webserver thingy, so we will expand it
# (expected_content should be uncompressed)
- @api.get("/nyan_cat_compressed.png", 200, nil, { "Content-Type" => "application/gzip", "Content-Encoding" => "gzip" } ) {
+ @api.get("/nyan_cat_compressed.png", 200, nil, { "Content-Type" => "application/gzip", "Content-Encoding" => "gzip" } ) do
File.open(nyan_compressed_filename, "rb") do |f|
f.read
end
- }
+ end
#
# endpoints that set Content-Length correctly
@@ -83,11 +83,11 @@ module ChefHTTPShared
{
"Content-Length" => nyan_uncompressed_size.to_s,
}
- ) {
+ ) do
File.open(nyan_uncompressed_filename, "rb") do |f|
f.read
end
- }
+ end
# (expected_content should be uncompressed)
@api.get("/nyan_cat_content_length_compressed.png", 200, nil,
@@ -96,11 +96,11 @@ module ChefHTTPShared
"Content-Type" => "application/gzip",
"Content-Encoding" => "gzip",
}
- ) {
+ ) do
File.open(nyan_compressed_filename, "rb") do |f|
f.read
end
- }
+ end
#
# endpoints that simulate truncated downloads (bad content-length header)
@@ -111,11 +111,11 @@ module ChefHTTPShared
{
"Content-Length" => (nyan_uncompressed_size + 1).to_s,
}
- ) {
+ ) do
File.open(nyan_uncompressed_filename, "rb") do |f|
f.read
end
- }
+ end
# (expected_content should be uncompressed)
@api.get("/nyan_cat_truncated_compressed.png", 200, nil,
@@ -124,11 +124,11 @@ module ChefHTTPShared
"Content-Type" => "application/gzip",
"Content-Encoding" => "gzip",
}
- ) {
+ ) do
File.open(nyan_compressed_filename, "rb") do |f|
f.read
end
- }
+ end
#
# in the presence of a transfer-encoding header, we must ignore the content-length (this bad content-length should work)
@@ -140,11 +140,11 @@ module ChefHTTPShared
"Content-Length" => (nyan_uncompressed_size + 1).to_s,
"Transfer-Encoding" => "anything",
}
- ) {
+ ) do
File.open(nyan_uncompressed_filename, "rb") do |f|
f.read
end
- }
+ end
#
# 403 with a Content-Length