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
On Jan 8, 2008 1:25 PM, Matt Patterson <[EMAIL PROTECTED]> wrote:
> On 8 Jan 2008, at 19:14, Daniel Tenner wrote:
>
>
> > Might be a personal thing, but my approach is that I try to test the
> > public behaviour of the object. Testing private methods is, imho,
> > getting dangerously close to speci
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
On Jan 8, 2008 2:47 PM, Chris Olsen <[EMAIL PROTECTED]> wrote:
> Will obj.send(:method) work in 1.9 or is it saying that the send call
> requires 2 params, the method and the object reference?
In 1.9 you can say obj.send!(:method) even if :method is private.
obj.send(:method) will not work for pri
Will obj.send(:method) work in 1.9 or is it saying that the send call
requires 2 params, the method and the object reference?
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman
Well there we go, Ben's method still stands :)
Tim
On Jan 8, 2008, at 12:36 PM, Ben Mabey wrote:
> Yes. http://eigenclass.org/hiki/Changes+in+Ruby+1.9#l24
>
> Tim Harper wrote:
>> Doesn't 1.9 allow you to call obj.send!, which will allow you to
>> access private methods?
>>
>> Tim
>>
>> On Ja
Yes. http://eigenclass.org/hiki/Changes+in+Ruby+1.9#l24
Tim Harper wrote:
> Doesn't 1.9 allow you to call obj.send!, which will allow you to
> access private methods?
>
> Tim
>
> On Jan 8, 2008, at 12:27 PM, Scott Taylor wrote:
>
>
>> On Jan 8, 2008, at 2:20 PM, Ben Mabey wrote:
>>
>>
>
Doesn't 1.9 allow you to call obj.send!, which will allow you to
access private methods?
Tim
On Jan 8, 2008, at 12:27 PM, Scott Taylor wrote:
>
> On Jan 8, 2008, at 2:20 PM, Ben Mabey wrote:
>
>> Chris Olsen wrote:
>>> How does a person test private methods?
>>>
>>> Is there a way to declare t
On Jan 8, 2008, at 2:20 PM, Ben Mabey wrote:
> Chris Olsen wrote:
>> How does a person test private methods?
>>
>> Is there a way to declare them as private, but retain any tests that
>> were written during the initial development?
>>
>> Thanks.
>>
> When I need to do this I just use the send met
On 8 Jan 2008, at 19:14, Daniel Tenner wrote:
> Might be a personal thing, but my approach is that I try to test the
> public behaviour of the object. Testing private methods is, imho,
> getting dangerously close to specifying how the object does its
> business, rather than what it does.
>
If yo
Chris Olsen wrote:
> How does a person test private methods?
>
> Is there a way to declare them as private, but retain any tests that
> were written during the initial development?
>
> Thanks.
>
When I need to do this I just use the send method.
-Ben
Might be a personal thing, but my approach is that I try to test the
public behaviour of the object. Testing private methods is, imho,
getting dangerously close to specifying how the object does its
business, rather than what it does.
I would just spec the externally visible behaviour, where
On 8 Jan 2008, at 18:39, Chris Olsen wrote:
> How does a person test private methods?
>
> Is there a way to declare them as private, but retain any tests that
> were written during the initial development?
I'm rather liking Jay Field's approach (described at http://
blog.jayfields.com/2007/11/ru
On 8 Jan 2008, at 17:01, Bryan Liles wrote:
>> Is there a better way to require rspec (this worked fine in 1.0.8 and
>> recent trunks), or should I be filing a bug?
>>
> I think it is some weird bug, and the solution that I am using until
> it is resolved is to do this add this to my rake task.
>
How does a person test private methods?
Is there a way to declare them as private, but retain any tests that
were written during the initial development?
Thanks.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyfor
On Jan 8, 2008, at 10:55 AM, Matt Patterson wrote:
>
>
> When you invoke rake to do something, say check_manifest
>
>
>> rake check_manifest
>>
>
> You wind up with a Runtime error, as follows:
>
>
>> /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.1/lib/spec/runner/
>> options.rb:216:in `files_to_loa
This is interesting.
The default rspec rake tasks generated by Hoe give you an rspec.rake
file that looks like:
> begin
> require 'spec'
> rescue LoadError
> require 'rubygems'
> require 'spec'
> end
>
So far so good.
When you invoke rake to do something, say check_manifest
> rake ch
17 matches
Mail list logo