Kill trailing whitespace in ruby files

This commit is contained in:
小太
2013-03-19 23:10:10 +11:00
parent c107f96cec
commit cba839ba76
319 changed files with 2710 additions and 2710 deletions

View File

@@ -8,32 +8,32 @@ module Downloads
@tempfile = Tempfile.new("danbooru-test")
@download = Downloads::File.new(@source, @tempfile.path)
end
teardown do
@tempfile.close
end
should "stream a file from an HTTP source" do
@download.http_get_streaming do |resp|
assert_equal("200", resp.code)
assert(resp["Content-Length"].to_i > 0, "File should be larger than 0 bytes")
end
end
should "throw an exception when the file is larger than the maximum" do
assert_raise(Downloads::File::Error) do
@download.http_get_streaming(:max_size => 1) do |resp|
end
end
end
should "store the file in the tempfile path" do
@download.download!
assert_equal(@source, @download.source)
assert(::File.exists?(@tempfile.path), "temp file should exist")
assert(::File.size(@tempfile.path) > 0, "should have data")
end
should "initialize the content type" do
@download.download!
assert_match(/image\/gif/, @download.content_type)

View File

@@ -8,7 +8,7 @@ module Downloads
# @tempfile = Tempfile.new("danbooru-test")
# @download = Downloads::File.new(@source, @tempfile.path)
end
should "work" do
# @download.download!
# assert_equal(201248, ::File.size(@tempfile.path))

View File

@@ -1,5 +1,5 @@
# require 'test_helper'
#
#
# module Downloads
# class PixaTest < ActiveSupport::TestCase
# context "a download for a pixa image" do
@@ -8,7 +8,7 @@
# @tempfile = Tempfile.new("danbooru-test")
# @download = Downloads::File.new(@source, @tempfile.path)
# end
#
#
# should "work" do
# @download.download!
# assert_equal(104627, ::File.size(@tempfile.path))

View File

@@ -9,12 +9,12 @@ module Downloads
@download = Downloads::File.new(@source, @tempfile.path)
@download.download!
end
should "instead download the big version" do
assert_equal("http://img65.pixiv.net/img/kiyoringo/21755794_big_p2.png", @download.source)
end
end
context "a download for a html page" do
setup do
@source = "http://www.pixiv.net/member_illust.php?mode=big&illust_id=23828655"
@@ -23,12 +23,12 @@ module Downloads
@download = Downloads::File.new(@source, @tempfile.path)
@download.download!
end
should "work" do
assert_equal(185778, ::File.size(@tempfile.path))
end
end
context "a download for a small image" do
setup do
@source = "http://img02.pixiv.net/img/wanwandoh/4348318_m.jpg"
@@ -36,11 +36,11 @@ module Downloads
@download = Downloads::File.new(@source, @tempfile.path)
@download.download!
end
should "instead download the original version" do
assert_equal("http://img02.pixiv.net/img/wanwandoh/4348318.jpg", @download.source)
end
should "work" do
assert_equal(185778, ::File.size(@tempfile.path))
end

View File

@@ -1,5 +1,5 @@
# require 'test_helper'
#
#
# module Downloads
# class TinamiTest < ActiveSupport::TestCase
# context "a download for a pixa image" do
@@ -8,7 +8,7 @@
# @tempfile = Tempfile.new("danbooru-test")
# @download = Downloads::File.new(@source, @tempfile.path)
# end
#
#
# should "work" do
# @download.download!
# assert_equal(201248, ::File.size(@tempfile.path))