Permalink
Browse files

added an example for truncating url with a paramter which contains mu…

…ltibyte-characters; this example is now failed
  • Loading branch information...
mrkn committed Apr 12, 2010
1 parent bae7086 commit 47a22ac44c8122d8413f9191407749c6f589c2d1
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/plugins/tinyurl_spec.rb
@@ -75,4 +75,19 @@
Termtter::Client.execute('update http://www.google.co.jp/search?hl=ja&source=hp&q=ujihisa&lr=&aq=f&aqi=g4g-r6&aql=&oq=&gs_rfai=')
end
+
+ it 'truncates url with a parameter which contains multibyte-characters' do
+ Termtter::Client.register_command(
+ :name => :update, :alias => :u,
+ :exec => lambda do |url|
+ url.should match(/(bit\.ly|tinyurl|is\.gd)/)
+ p url
+ open(url) do |f|
+ f.base_uri.to_s.should match('?q=堀北真希')
+ end
+ end
+ )
+ Termtter::Client.plug 'tinyurl'
+ Termtter::Client.execute('update http://maps.google.co.jp/maps/place?q=北24条駅')
+ end
end

0 comments on commit 47a22ac

Please sign in to comment.