David Chelimsky wrote:
>
> Foo::Bar.stub(:do_something)
hmm. that's pretty close to where I started.
> If you stub, for example, do_something on this module, but it turns
> out that do_something gets added to the module through some dynamic
> means *after the stub declaration*, the stub declarati
Scott Taylor wrote:
Ben Mabey wrote:
Scott Taylor wrote:
Ben Johnson wrote:
Did anyone ever figure out the factory_girl / machinist issues? I
am having the same problems and can figure out how to fix it for
the life of me. The first run works fine, then afterwards I get a
bunch of these erro
On Mon, May 25, 2009 at 12:03 AM, Sarah Allen wrote:
> David Chelimsky wrote:
>> Stub methods on objects, not modules. The method can be one that
>> *comes from* a module, but you need to stub it on the specific object
>> that is at play in the example.
>
> That makes sense, except the code does t
On Sun, May 24, 2009 at 2:25 PM, Fernando Perez wrote:
>> In the meantime I have used alias_method_chain to override the method
>> in the super class.
> I up this old post, but I was having the same problem mocking super() so
> I had to alias_method_chain my method.
You can't mock super because s
David Chelimsky wrote:
> Stub methods on objects, not modules. The method can be one that
> *comes from* a module, but you need to stub it on the specific object
> that is at play in the example.
That makes sense, except the code does this:
Foo::Bar::do_something(path)
I'm not an expert with mod
On Sun, May 24, 2009 at 7:38 PM, Sarah Allen wrote:
> David Chelimsky wrote:
>> FYI - if you put this file in spec/helpers/swf_object_helper_spec.rb,
>> then :type => :helper is implied, so you don't have to make it
>> explicit.
>
> just curious... are there any other magic directories I should kn
On Sun, May 24, 2009 at 7:15 PM, Sarah Allen wrote:
> If there is a method defined on a module, how do I stub it?
>
> Imagine I have a module like this:
>
> Module Foo
> Module Bar
>
> def self.do_something(path)
> ...
> end
>
>
> end
> end
>
>
> Somewhere in the code, there is this cal
David Chelimsky wrote:
> FYI - if you put this file in spec/helpers/swf_object_helper_spec.rb,
> then :type => :helper is implied, so you don't have to make it
> explicit.
just curious... are there any other magic directories I should know
about?
Thanks,
Sarah
--
Posted via http://www.ruby-for
If there is a method defined on a module, how do I stub it?
Imagine I have a module like this:
Module Foo
Module Bar
def self.do_something(path)
...
end
end
end
Somewhere in the code, there is this call:
Foo::Bar::do_something(path)
In my test I want the above
David Chelimsky wrote:
> FYI - if you put this file in spec/helpers/swf_object_helper_spec.rb,
> then :type => :helper is implied, so you don't have to make it
> explicit.
Nice.
By the way, I've been enjoying The RSpec Book, but it looks like I had
to figure out view helpers before that chapter
On Sun, May 24, 2009 at 3:20 PM, Sarah Allen wrote:
> Sarah Allen wrote:
>> Sarah Allen wrote:
>>> line 17 is:
>>> html.should have_tag('script', /swfobject.embedSWF/)
>>
>> I order to use have_tag, it appears I have to include:
>>
>> # just enough infrastructure to get 'assert_select' to wo
On Sun, May 24, 2009 at 9:25 AM, Nick Hoffman wrote:
>
> In KeywordListsController#create, I call the private method
> #create_keywords_and_associate, which calls AdSenseHeavenParser#parse
> .
>
> Thus, some of my specs set an expectation on AdSenseHeavenParser#parse
> . However, that expectation
On Sun, May 24, 2009 at 3:25 PM, Rick DeNatale wrote:
>> However, that doesn't really matter. The call to #require shouldn't
>> happen, because the method is supposed to be stubbed out.
>
> No that's what confused me.
>
> class KeywordListsController < ApplicationController
> ...
> private
> ...
>> Hi Fernando. I'm not sure what you mean by "the code never gets out of
>> this require statement".
> I should have said 'the interpreter never ...'
Ah, I understand what you mean now.
>> However, that doesn't really matter. The call to #require shouldn't
>> happen, because the method is suppos
Sarah Allen wrote:
> Sarah Allen wrote:
>> line 17 is:
>> html.should have_tag('script', /swfobject.embedSWF/)
>
> I order to use have_tag, it appears I have to include:
>
> # just enough infrastructure to get 'assert_select' to work
> require 'action_controller'
> require 'action_controlle
On Sun, May 24, 2009 at 2:24 PM, Nick Hoffman wrote:
> On Sun, May 24, 2009 at 2:13 PM, Fernando Perez wrote:
>>> Hi Fernando. In this case, I don't think it's a matter of using the
>>> debugger.
>>
>> I suspect a problem in: require 'lib/adsense_heaven_parser', the code
>> maybe never gets out o
> Hi Fernando. I'm not sure what you mean by "the code never gets out of
> this require statement".
I should have said 'the interpreter never ...'
> However, that doesn't really matter. The call to #require shouldn't
> happen, because the method is supposed to be stubbed out.
You are making a lot
> In the meantime I have used alias_method_chain to override the method
> in the super class.
I up this old post, but I was having the same problem mocking super() so
I had to alias_method_chain my method.
--
Posted via http://www.ruby-forum.com/.
___
r
On Sun, May 24, 2009 at 2:13 PM, Fernando Perez wrote:
>> Hi Fernando. In this case, I don't think it's a matter of using the
>> debugger.
>
> I suspect a problem in: require 'lib/adsense_heaven_parser', the code
> maybe never gets out of this require statement. The debugger would allow
> you to i
> Hi Fernando. In this case, I don't think it's a matter of using the
> debugger.
I suspect a problem in: require 'lib/adsense_heaven_parser', the code
maybe never gets out of this require statement. The debugger would allow
you to immediately clear things out.
--
Posted via http://www.ruby-fo
2009/5/24 Fernando Perez :
> So I tried to implement Django's AutoAdmin, but actually it quite
> quickly blew in my face. Although the views all look similar, there
> almost as many little differences as they are models and that's painful
> to abstract. So I prefer to write my views for each model.
On Sun, May 24, 2009 at 1:10 PM, Rick DeNatale wrote:
> On Sun, May 24, 2009 at 12:25 PM, Nick Hoffman wrote:
>> Hi guys. I'm setting an expectation on a class method. For some
>> reason, the method isn't being stubbed, and the expectation isn't
>> seeing the call.
>>
>> In KeywordListsController
On Sun, May 24, 2009 at 12:25 PM, Nick Hoffman wrote:
> Hi guys. I'm setting an expectation on a class method. For some
> reason, the method isn't being stubbed, and the expectation isn't
> seeing the call.
>
> In KeywordListsController#create, I call the private method
> #create_keywords_and_asso
On Sun, May 24, 2009 at 12:49 PM, Fernando Perez wrote:
>> I've been beating my head against this for a couple of hours. Any
>> thoughts?
> The easiest for you is to use the debugger and go through each line in
> the controller.
>
> Maybe @keyword_list.save is returning false? Stub it out and see
So I tried to implement Django's AutoAdmin, but actually it quite
quickly blew in my face. Although the views all look similar, there
almost as many little differences as they are models and that's painful
to abstract. So I prefer to write my views for each model.
Now I have another problem, so
> I've been beating my head against this for a couple of hours. Any
> thoughts?
The easiest for you is to use the debugger and go through each line in
the controller.
Maybe @keyword_list.save is returning false? Stub it out and see by
yourself.
--
Posted via http://www.ruby-forum.com/.
__
Hi guys. I'm setting an expectation on a class method. For some
reason, the method isn't being stubbed, and the expectation isn't
seeing the call.
In KeywordListsController#create, I call the private method
#create_keywords_and_associate, which calls AdSenseHeavenParser#parse
.
Thus, some of my s
Ben Mabey wrote:
Scott Taylor wrote:
Ben Johnson wrote:
Did anyone ever figure out the factory_girl / machinist issues? I am
having the same problems and can figure out how to fix it for the
life of me. The first run works fine, then afterwards I get a bunch
of these errors:
No blueprint fo
28 matches
Mail list logo