aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshiaki Asai <toshi.alternative@gmail.com>2014-07-24 00:41:57 +0900
committerToshiaki Asai <toshi.alternative@gmail.com>2014-07-24 00:41:57 +0900
commit4720482e05f119a90389fac4ada43ebbabc551e2 (patch)
tree772cbabc3f68b7c60da0a2df83d28f9d288aadcd /test
parent73191a9575f852f5d3c8be6708dae4518dfe8b86 (diff)
downloadmikutter-4720482e05f119a90389fac4ada43ebbabc551e2.tar.gz
web_image_loader: テストで、イベントのためにMockを使わなくていいところで使ってた
Diffstat (limited to 'test')
-rw-r--r--test/core/test_web_image_loader.rb18
1 files changed, 2 insertions, 16 deletions
diff --git a/test/core/test_web_image_loader.rb b/test/core/test_web_image_loader.rb
index faeab7d2..d767ee49 100644
--- a/test/core/test_web_image_loader.rb
+++ b/test/core/test_web_image_loader.rb
@@ -8,24 +8,12 @@ ICON_TEST = File.expand_path(File.dirname(__FILE__) + "/icon_test.png")
miquire :mui, 'web_image_loader'
miquire :lib, 'delayer'
-
-Plugin = Class.new do
- def self.call(*args); end
-end
+miquire :core, 'plugin'
class TC_GtkWebImageLoader < Test::Unit::TestCase
def setup
- Gdk::WebImageLoader::ImageCache.clear
- urls = ['http://a0.twimg.com/profile_images/1522298893/itiiti_hitono_icon_no_file_mei_mirutoka_teokure_desune.png',
- 'http://a0.twimg.com/profile_images/1522298893/みくかわいい.png',
- 'http://internal.server.error/',
- 'http://notfound/']
- urls.each{ |u|
- Plugin.stubs(:filtering).with(:image_cache, u, nil).returns([u, nil]) }
- urls.each{ |u|
- Plugin.stubs(:filtering).with(:web_image_loader_url_filter, u, nil).returns([u, nil]) }
- end
+ Gdk::WebImageLoader::ImageCache.clear end
must "not found" do
WebMock.stub_request(:get, "notfound").to_return(:status => 404)
@@ -86,7 +74,6 @@ class TC_GtkWebImageLoader < Test::Unit::TestCase
must "successfully load local image" do
url = File.join(File.dirname(__FILE__), '../../core/skin/data/icon.png')
- Plugin.stubs(:filtering).with(:web_image_loader_url_filter, url).returns([url])
response = Gdk::WebImageLoader.pixbuf(url, 48, 48)
(Thread.list - [Thread.current]).each &:join
Delayer.run
@@ -95,7 +82,6 @@ class TC_GtkWebImageLoader < Test::Unit::TestCase
end
must "local file not found" do
- Plugin.stubs(:filtering).with(:web_image_loader_url_filter, 'notfound-file').returns(['notfound-file'])
response = Gdk::WebImageLoader.pixbuf('notfound-file', 48, 48)
(Thread.list - [Thread.current]).each &:join
Delayer.run