rubocop: fix various style issues.

This commit is contained in:
evazion
2019-12-22 16:21:58 -06:00
parent 09f6a84660
commit 309821bf73
288 changed files with 912 additions and 962 deletions

View File

@@ -10,7 +10,7 @@ module Downloads
end
teardown do
ENV["SKIP_CLOUDFLARE_CHECK"] = nil
ENV["SKIP_CLOUDFLARE_CHECK"] = nil
end
context "for a banned IP" do
@@ -59,7 +59,7 @@ module Downloads
HTTParty.expects(:get).twice.multiple_yields(chunk, bomb).then.multiple_yields(chunk, chunk).returns(resp)
@download.stubs(:is_cloudflare?).returns(false)
tempfile, _ = @download.download!
tempfile, _strategy = @download.download!
assert_equal("aa", tempfile.read)
end
@@ -78,7 +78,7 @@ module Downloads
should "correctly save the file when following 302 redirects" do
download = Downloads::File.new("https://yande.re/post/show/578014")
file, strategy = download.download!(url: download.preview_url)
file, strategy = download.download!(url: download.preview_url)
assert_equal(19134, file.size)
end
end

View File

@@ -109,7 +109,6 @@ module Downloads
assert_not_rewritten(@file_url)
assert_downloaded(@file_size, @file_url)
end
end
context "downloading a background image" do
@@ -157,9 +156,9 @@ module Downloads
should "capture the data" do
assert_equal(2, @download.data[:ugoira_frame_data].size)
if @download.data[:ugoira_frame_data][0]["file"]
assert_equal([{"file"=>"000000.jpg", "delay"=>125}, {"file"=>"000001.jpg", "delay"=>125}], @download.data[:ugoira_frame_data])
assert_equal([{"file" => "000000.jpg", "delay" => 125}, {"file" => "000001.jpg", "delay" => 125}], @download.data[:ugoira_frame_data])
else
assert_equal([{"delay_msec"=>125}, {"delay_msec"=>125}], @download.data[:ugoira_frame_data])
assert_equal([{"delay_msec" => 125}, {"delay_msec" => 125}], @download.data[:ugoira_frame_data])
end
end
end

View File

@@ -4,7 +4,7 @@ module Downloads
class TumblrTest < ActiveSupport::TestCase
# Currently there's no way to obtain the raw version of these images,
# so we have to change the tests to validate against the 1280 version
context "a download for a tumblr 500 sample" do
should "instead download the 1280 version" do
skip "Tumblr keys are not set" unless Danbooru.config.tumblr_consumer_key