Show
Ignore:
Timestamp:
02/12/08 15:14:41 (10 months ago)
Author:
cho45
Message:

lang/ruby/chokan/branches/citrus/plugins:

テスト時の @socket には Queue をつかうように。

  • スレッドを扱うテストをスマートかつ確実に書けるように

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/chokan/branches/citrus/plugins/simple_reply.rb

    r6479 r6594  
    3232 
    3333                it "should reply correctly" do 
    34                         @socket.string = "" 
     34                        @socket.clear 
    3535                        @plugin.on_privmsg(@prefix, "#test", "foo") 
    36                         @socket.string.should == "NOTICE #test :Nice boat.\r\n" 
     36                        @socket.pop.to_s.should == "NOTICE #test :Nice boat.\r\n" 
    3737 
    38                         @socket.string = "" 
     38                        @socket.clear 
    3939                        @plugin.on_privmsg(@prefix, "#test", "bar") 
    40                         @socket.string.should == "NOTICE #test :Nice boat.\r\n" 
     40                        @socket.pop.to_s.should == "NOTICE #test :Nice boat.\r\n" 
    4141 
    42                         @socket.string = "" 
     42                        @socket.clear 
    4343                        @plugin.on_privmsg(@prefix, "#test", "baz") 
    44                         @socket.string.should == "" 
     44                        @socket.should be_empty 
    4545 
    46                         @socket.string = "" 
     46                        @socket.clear 
    4747                        @plugin.on_privmsg(@prefix, "#test2", "foo") 
    48                         @socket.string.should == "" 
     48                        @socket.should be_empty 
    4949                end 
    5050        end