Hi all,
I hope I can get a quick pointer about the following problem:
I have a controller spec with 38 examples, all green if run from
*within* TextMate.
>From the shell, however (through either rake or autotest) I get a
handful of pink errors.
For example, I get a few TypeErrors ("can't convert
HI Giuseppe,
I had a similar situation, only reversed. All ran with autotest, but
failed in Textmate. I found the problem was in how I was including
some helper modules and correcting that solved the problem.
On Tue, Apr 15, 2008 at 9:20 AM, Giuseppe Bertini <[EMAIL PROTECTED]> wrote:
> Hi all,
>
I'm somewhat new to testing and rspec. And I'm struggling a bit with
the application of Mocks and Stubs in a Rails application. I think I'm
beginning to grasp it, but I'm stuck on how to spec the following:
I have a User model which has a has_many relationship to Trip models,
and the impleme
Hi Matt,
> I had a similar situation, only reversed. All ran with autotest, but
> failed in Textmate. I found the problem was in how I was including
> some helper modules and correcting that solved the problem.
right, I've heard about that before, and I thought that my problem may
be similar in
Giuseppe Bertini wrote:
> Hi Matt,
>
>
>> I had a similar situation, only reversed. All ran with autotest, but
>> failed in Textmate. I found the problem was in how I was including
>> some helper modules and correcting that solved the problem.
>>
>
> right, I've heard about that before, and
> catch any dependencies your tests may have on each other
> in order to reveal brittle tests.
Following Ben's hint, I took out examples from the controller spec until
I isolated the culprit.
Briefly, I am switching from RSpec's built in mocking framework to Mocha
and fixture_scenarios when nec
I'm testing an ActiveRecord model using rspec and mocha, and found that
if I stub out the :valid? method, all before_validation callbacks are
also skipped!
Not ideal - I still want the callbacks to execute, but the validation to
return true.
Anyone know how to achieve this?
class Item < ActiveRec
That'll learn ya to use Mocha over rSpec ;)
On Tue, Apr 15, 2008 at 2:27 PM, Giuseppe Bertini <[EMAIL PROTECTED]>
wrote:
> > catch any dependencies your tests may have on each other
> > in order to reveal brittle tests.
>
> Following Ben's hint, I took out examples from the controller spec until
On 15 Apr 2008, at 23:05, Zubin Henner wrote:
> Item.any_instance.stubs(:valid?).returns(true)
> item = Item.new
> item.valid?
Any reason why you are not using pure mocks here? I assume it's not
Item you are testing, but some other model that is associated with it?
Ashley
--
http://www.pa
Ashley Moran wrote:
> Any reason why you are not using pure mocks here? I assume it's not
> Item you are testing, but some other model that is associated with it?
Hi Ashley, yes, you're spot on - I'm using other associated models. I
just simplified it for illustration. Here's what I'm really tes
> Not sure why you are stubbing entries on the controller ... entries is
> called on the current user ...
I have this method. I want to use this variable to loop the users
@entries. So I'm testing to see that this variable is tested and works
correctly.
def main
@entries = current_user.entrie
On Apr 15, 2008, at 7:08 PM, newbie wrote:
>> Not sure why you are stubbing entries on the controller ... entries
>> is
>> called on the current user ...
>
> I have this method. I want to use this variable to loop the users
> @entries. So I'm testing to see that this variable is tested and works
So I added OpenID to my application (via the openid plugin). But I'm
having troubles writing the story for it -- specifically, how to mock
the openid calls.
Anyone got any quick pointers?
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rub
Hi folks - I'm trying to build a rake task to run our plain-text
stories, both from a normal build and from our continuous integration
server.
However, I'm having a problem - running all.rb doesn't return any sort
of success/failure - so a broken story doesn't indicate to Cruise
Control that the b
This is a rather open ended question, Joe. You might want to get a
little more detailed.
Would you happen to have any code to paste or a specific problem? I
think you might have a tough time finding someone who has written
specific mocks around the openid calls.
On Apr 15, 2008, at 8:09 PM,
Korny Sietsma wrote:
> Hi folks - I'm trying to build a rake task to run our plain-text
> stories, both from a normal build and from our continuous integration
> server.
>
> However, I'm having a problem - running all.rb doesn't return any sort
> of success/failure - so a broken story doesn't indic
16 matches
Mail list logo