root/lang/ruby/ssb/trunk/test/filter_test.rb @ 2306

Revision 2295, 0.6 kB (checked in by tokuhirom, 7 years ago)

lang/ruby/ssb: oops. fix broken test.

Line 
1require File.expand_path(File.dirname(__FILE__) + '/test_helper')
2require 'ssb/emoji.rb'
3require 'ssb/ktai_spec.rb'
4require 'ssb.rb'
5
6class Term
7  def initialize(carrier)
8    @carrier = carrier
9  end
10 
11  attr_reader :carrier
12  alias :get_carrier :carrier
13end
14
15unit_tests do
16  def conv(carrier, str)
17    SSB::Emoji.emoji_conv(Term.new(carrier), str)
18  end
19 
20  test 'filter a tag' do
21    assert_equal(
22        SSB::Application.filter_html("<a href='/bar'>foo</a>", URI.parse('http://example.com/foo'), Term.new(SSB::KtaiSpec::CARRIER_DOCOMO), '', ''),
23        %Q{<a href=\"./?q=http%3A%2F%2Fexample.com%3A80%2Fbar\" target=\"_top\" >foo</a>}
24    )
25  end
26end
27
Note: See TracBrowser for help on using the browser.