[typo] jabber_notify.rb error

Piers Cawley pdcawley at bofh.org.uk
Fri Apr 14 14:55:09 EDT 2006

Trejkaz <trejkaz at trypticon.org> writes:

> On Friday 14 April 2006 14:35, Piers Cawley wrote:
>> Piers Cawley <pdcawley at bofh.org.uk> writes:
>> > extra understanding from the first, failed solution. As I've explained
>> > in my blog[1], I'm not totally averse (but getting more averse by
>> Oopsie. Forgot the footnote. Here it is:
>> 1. http://www.bofh.org.uk/articles/2006/03/12/if-you-test-it-i-will-patch
> Just out of curiosity, how does one test a feature which by its very nature 
> requires contact with a server somewhere?  Is there a common Jabber server 
> which unit tests might be able to connect to, which would always be present 
> in order to test something like Jabber notifications?

Am I correct in remembering that Jabber's a peer to peer protocol?
Presumably you can just fire up a client object in some sort of accept
connections mode and use that as your jabber server. 

I'd also suggest looking at how the XMPP4R tests themselves do
it. Essentially, you need to check that typo is sending the right
stuff to the library, so you might be able to get away with stubbing
the entire connection.

> The same problem exists with mail notifications, naturally.
> One might say that you can stub the thing which sends the mail. 

That's pretty much what we do.

> But if you also stubbed the thing which sends the instant message,
> the existing notification for Jabber would seem to be working,
> because the broken code is inside the method you would need to stub.

That being a method in the library yes? Presumably the library we're
planning on replacing jabber4r with comes with its own test suite? If
so, we just trust that it will do the right thing given the right
input. What we don't have at the moment are any tests to ensure that
it *does* get given the right input. 

Piers Cawley <pdcawley at bofh.org.uk>

More information about the Typo-list mailing list