aboutsummaryrefslogtreecommitdiffstats
path: root/test/core
diff options
context:
space:
mode:
authorToshiaki Asai <toshi.alternative@gmail.com>2014-06-28 18:05:31 +0900
committerToshiaki Asai <toshi.alternative@gmail.com>2014-06-28 18:27:29 +0900
commitd8abf47af541b9c143a5cfb03e50051da0988f1e (patch)
treebb39900e82f6bc4c156df3a45423e3ab5d98e2c9 /test/core
parentf88e4a8d9dae58ca9c98a54775a30f523bef7843 (diff)
downloadmikutter-d8abf47af541b9c143a5cfb03e50051da0988f1e.tar.gz
MessageConverterを完全に削除。URL展開はフィルタに置き換え、MessageConverter関係のテストは全て削除 refs #702
Diffstat (limited to 'test/core')
-rw-r--r--test/core/test_entity.rb24
-rw-r--r--test/core/test_messageconverters.rb50
2 files changed, 0 insertions, 74 deletions
diff --git a/test/core/test_entity.rb b/test/core/test_entity.rb
index b00591c1..b1d274e6 100644
--- a/test/core/test_entity.rb
+++ b/test/core/test_entity.rb
@@ -91,30 +91,6 @@ class TC_Message < Test::Unit::TestCase
splited
end
-
- def test_2
- mes = stub
- mes.stubs(:to_show).returns(THE_TWEET2)
- mes.stubs(:[]).with(:entities).returns(THE_ENTITY2)
- mes.stubs(:is_a?).with(Message).returns(true)
-
- Plugin.stubs(:filtering).with(:expand_url, 'http://bit.ly/3YP9Hq').returns(['http://www.last.fm/music/Rihanna/_/Unfaithful'])
- Plugin.stubs(:filtering).with(:expand_url, 'http://bit.ly/1tmPYb').returns(['http://www.amazon.com/A-Girl-Like-Me/dp/B001144EBA?SubscriptionId=12CBBK5SPFDF9BJG9N82&tag=nickelscom-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B001144EBA'])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://bit.ly/3YP9Hq').returns([false])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://bit.ly/1tmPYb').returns([false])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://www.last.fm/music/Rihanna/_/Unfaithful').returns([true])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://www.amazon.com/A-Girl-Like-Me/dp/B001144EBA?SubscriptionId=12CBBK5SPFDF9BJG9N82&tag=nickelscom-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B001144EBA').returns([true])
-
- entity = Message::Entity.new(mes)
-
- # pp entity.to_a
-
- a = entity.to_a.map{ |x| x.dup.tap{|n|n.delete(:regexp)} }
-
- assert_kind_of(String, entity.to_s)
- assert_equal('&#9829; Unfaithful by Rihanna #lastfm: http://www.last.fm/music/Rihanna/_/Unfaithful amazon: http://www.amazon.com/A-Girl-Like-Me/dp/B001144EBA?SubscriptionId=12CBBK5SPFDF9BJG9N82&tag=nickelscom-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B001144EBA', entity.to_s.inspect)
- end
-
def test_3
mes = stub
mes.stubs(:to_show).returns(THE_TWEET3)
diff --git a/test/core/test_messageconverters.rb b/test/core/test_messageconverters.rb
deleted file mode 100644
index 263d495d..00000000
--- a/test/core/test_messageconverters.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# -*- coding: utf-8 -*-
-require File.expand_path(File.dirname(__FILE__) + '/../helper')
-miquire :core, 'messageconverters'
-miquire :lib, 'weakstorage'
-
-$debug = true
-$logfile = nil
-$daemon = false
-
-class Plugin
-end
-
-class TC_MessageConverters < Test::Unit::TestCase
- # include FlexMock::TestCase
-
- def setup
- end
-
- def test_shrink
- Plugin.stubs(:filtering).with(:shrink_url, 'http://google.jp/').returns(['http://ha2.ne/156'])
- Plugin.stubs(:filtering).with(:shrink_url, 'http://mikutter.d.hachune.net/').returns(['http://ha2.ne/39'])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://google.jp/').returns(['http://google.jp/'])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://mikutter.d.hachune.net/').returns(['http://mikutter.d.hachune.net/'])
-
- w = MessageConverters.shrink_url_all('watching: http://mikutter.d.hachune.net/')
- assert_equal('watching: http://ha2.ne/39', w)
- w = MessageConverters.shrink_url_all('watching: http://mikutter.d.hachune.net/ http://google.jp/')
- assert_equal("watching: http://ha2.ne/39 http://ha2.ne/156", w)
- end
-
- def test_expand
- Plugin.stubs(:filtering).with(:expand_url, 'http://ha2.ne/156').returns(['http://google.jp/'])
- Plugin.stubs(:filtering).with(:expand_url, 'http://ha2.ne/39').returns(['http://mikutter.d.hachune.net/'])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://ha2.ne/39').returns([false])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://ha2.ne/156').returns([false])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://google.jp/').returns([true])
- Plugin.stubs(:filtering).with(:is_expanded, 'http://mikutter.d.hachune.net/').returns([true])
-
- w = MessageConverters.expand_url_all('watching: http://ha2.ne/156')
- assert_equal("watching: http://google.jp/", w)
- w = MessageConverters.expand_url_all('watching: http://ha2.ne/156 http://ha2.ne/39')
- assert_equal("watching: http://google.jp/ http://mikutter.d.hachune.net/", w)
- end
-end
-# >> Loaded suite -
-# >> Started
-# >> ..
-# >> Finished in 0.003505 seconds.
-# >>
-# >> 2 tests, 4 assertions, 0 failures, 0 errors