Changeset 2940 for lang/ruby/ssb
- Timestamp:
- 12/09/07 17:11:51 (13 months ago)
- Location:
- lang/ruby/ssb/trunk
- Files:
-
- 2 modified
-
README (modified) (2 diffs)
-
test/filter_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/ssb/trunk/README
r2324 r2940 12 12 - lha (KDDI絵文字アーカイブ解凍) 13 13 - dust (unit test) 14 - flexmock (unit test mocks) 14 15 15 16 動作確認環境: … … 24 25 - scrapi 1.2.0 (gem) 25 26 - dust 0.1.6 (gem) 26 27 - flexmock 0.8.0 (gem) 27 28 28 29 How to install: -
lang/ruby/ssb/trunk/test/filter_test.rb
r2695 r2940 3 3 require 'ssb/ktai_spec.rb' 4 4 require 'ssb.rb' 5 6 class Term 7 def initialize(carrier) 8 @carrier = carrier 9 end 10 11 attr_reader :carrier 12 alias :get_carrier :carrier 13 end 5 require 'flexmock/test_unit' 14 6 15 7 unit_tests do 16 def conv(carrier, str)17 SSB::Emoji.emoji_conv(Term.new(carrier), str)18 end19 20 8 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=\"./?ssb_q=http%3A%2F%2Fexample.com%3A80%2Fbar\" target=\"_top\" >foo</a>} 24 ) 9 term = flexmock("term") 10 term.should_receive(:get_carrier).and_return(SSB::KtaiSpec::CARRIER_DOCOMO) 11 expected = %Q{<a href=\"./?ssb_q=http%3A%2F%2Fexample.com%3A80%2Fbar\" target=\"_top\" >foo</a>} 12 filtered = SSB::Application.filter_html("<a href='/bar'>foo</a>", URI.parse('http://example.com/foo'), term, '') 13 assert_equal(expected, filtered) 25 14 end 26 15 end 27
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)