Re: [rspec-users] Textmate RSpec Bundle 'it' snippet

2008-01-26 Thread Francois Wurmus
Hi Matt, one way of doing this is to leave the block out and just write: it "should bla bla" No 'do', no 'end'. The example will be pending this way. François Matt Darby schrieb: > It seems to me that the RSpec bundle's 'it' snippet is in need of some > love. By default, a newly inserted

Re: [rspec-users] specs on private methods

2008-01-10 Thread Francois Wurmus
Yes, you're absolutely right. I somehow ignored the class name in my previous answers, but that would have been the next point of attack. ;-) Pat Maddox schrieb: > On Jan 10, 2008 12:34 PM, Francois Wurmus <[EMAIL PROTECTED]> wrote: >> Even my suggestion wouldn't b

Re: [rspec-users] specs on private methods

2008-01-10 Thread Francois Wurmus
Even my suggestion wouldn't be a sufficient spec. What about completely wrong mac addresses? Empty addresses, too many characters, invalid characters? It is not for nothing that the rspec test cases are called examples - you may define any number of example inputs and expected outputs that are

Re: [rspec-users] specs on private methods

2008-01-10 Thread Francois Wurmus
Apart from private or public methods I see a problem in your test case. You don't make sure that your mac_address is returned in exactly the way you want - you are merely saying it should look like the return value of some (protected) method you call (normalize_mac). Let's assume this method was

Re: [rspec-users] specs on private methods

2008-01-08 Thread Francois Wurmus
obj.send(:method) will work for non-private methods and send! works for private methods. additionally there is send() without a receiving object. that is the only of those methods requiring two parameters. Chris Olsen schrieb: > Will obj.send(:method) work in 1.9 or is it saying that the send

Re: [rspec-users] specs on private methods

2008-01-08 Thread Francois Wurmus
The send call never expects an object reference as a parameter. Either it is called on an object or without an object context (i.e. kernel). In the first case the parameter should contain one of the receiving object's methods. In the second case the parameter is a kernel method. But... that's n