Hi,
I am trying to stub a class in my controller and I can't get it to
work, the controller code is:
def show
@server = Server.find(params[:id])
whm = Whm::Client.new @server
@server_load = whm.loadavg
end
and my test code:
before(:each) do
@server = mock_model(Server)
Thanks Pat,
I wrote my first custom matcher and its all working now.
Jamie
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Ashley, Edvard:
Thank you both for your advice and comments.
For now, I've implemented fixture_replacement.
Perhaps a story would be better, but this is working well for now.
Cheers,
Zubin
--
Posted via http://www.ruby-forum.com/.
___
rspec-users maili
On Apr 18, 2008, at 5:14 PM, Rick DeNatale wrote:
> Some have probably already discovered this but I've been working
> through some ui stories, using the rails integration test stuff.
>
> I had a story where one very used step was failing in one place. The
> failing expectation looked like this:
On Fri, Apr 4, 2008 at 7:10 PM, Joe Van Dyk <[EMAIL PROTECTED]> wrote:
> On Fri, Mar 21, 2008 at 5:46 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> > On Fri, Mar 21, 2008 at 1:35 AM, Joe Van Dyk <[EMAIL PROTECTED]> wrote:
> > > On Thu, Mar 20, 2008 at 3:34 AM, Rick DeNatale <[EMAIL PROTECTED]
Some have probably already discovered this but I've been working
through some ui stories, using the rails integration test stuff.
I had a story where one very used step was failing in one place. The
failing expectation looked like this:
response.should have_tag("tr.group_info_row td",grou
Hi Pat,
Wow. Thank you for a very nice response. As others have said, this
would be a stellar blog post. As you stated, it does all depend, but
the theory that you provided will help me to determine what exactly I
am trying to solve with the particular test. I am definitely saving
this email, and
On 17 apr 2008, at 15:44, Joseph Wilk wrote:
> Hello,
>
> I've come across a similar problem. Sharing the steps is the easy bit.
> And I've started to create a 'useful_steps.rb' for storing very common
> steps.
So have I. I use a lot of "Given a number of flurps in the system",
and "When I add
El 18/4/2008, a las 14:16, David Chelimsky <[EMAIL PROTECTED]>
escribió:
> On Apr 18, 2008, at 3:43 AM, Dan North wrote:
>
>> With mercurial I nearly did a similar thing, working on my own but
>> committing from two different machines. Luckily mercurial gave me a
>> warning that allowed me to mak
On Apr 18, 2008, at 6:49 AM, Wincent Colaiuta wrote:
> I don't have a github account at this stage but here folllows a write-
> up that you could use to start a new page.
>
> Cheers,
> Wincent
>
> Using topic branches when contributing patches
Thanks Wincent - very nice writeup!
Posted to the wik
On Apr 18, 2008, at 6:16 AM, Ashley Moran wrote:
> On 18 Apr 2008, at 10:39, Andy Croll wrote:
>>> do_delete :)
>>
>> I do so love mistakes in public, don't you?
>
> I do this SO often - hopefully I'm not alone :) - I am starting to
> wish RSpec would ask me "Didn't you mean to make a request in t
On Apr 18, 2008, at 3:43 AM, Dan North wrote:
With mercurial I nearly did a similar thing, working on my own but
committing from two different machines. Luckily mercurial gave me a
warning that allowed me to make sense of what I was doing. Not sure
how this works with git but here goes.
1
El 18/4/2008, a las 11:44, "Pat Maddox" <[EMAIL PROTECTED]> escribió:
> I believe that pull-merge-commit would work fine, I experimented
> locally to understand the effects of handling submodule reference
> merge conflicts. As I mentioned before, it is just a bit of a hassle
> to have to do. Dav
On 18 Apr 2008, at 10:44, Chris Parsons wrote:
> Very nice reply Pat. This would make a great blog post if you get a
> chance.
+1
I especially like the line "The art of all of this is identifying the
set of tests that
maximizes your confidence and ability to produce valuable software."
Ashl
On 18 Apr 2008, at 10:39, Andy Croll wrote:
>> do_delete :)
>
> I do so love mistakes in public, don't you?
I do this SO often - hopefully I'm not alone :) - I am starting to
wish RSpec would ask me "Didn't you mean to make a request in this
example?"
I'm used to it now though... it's usuall
Hi Ashley,
Thanks for the response and sorry for the delay, I did not have the time to
play with rspec these days.
On Wed, Apr 16, 2008 at 10:15 AM, Ashley Moran <
[EMAIL PROTECTED]> wrote:
> Did you mean: "run 'login.txt'" here?
No, I really got it wrong. :)
I will take a look at the rest of t
Jarkko Laine wrote:
> I would perhaps use
>
>> it "should redirect to the previous page" do
>>response.should redirect_to "/prev/page"
>> end
Yeah, I'd pulled it back to see what *really* simple mistake I was
making. :-) I reintroduced it in my next 'write test -> fail -> write
code -> p
It seems like I'm constantly making long-winded replies that would be
better off in a blog post or in a book.
Pat
On Fri, Apr 18, 2008 at 2:44 AM, Chris Parsons
<[EMAIL PROTECTED]> wrote:
> Very nice reply Pat. This would make a great blog post if you get a chance.
>
> Thanks
> Chris
>
>
>
> On
Very nice reply Pat. This would make a great blog post if you get a
chance.
Thanks
Chris
On 18 Apr 2008, at 10:15, Pat Maddox wrote:
Hey Matt,
The ultimate test would be one that is focused on one thing such that
the test would
- break every time that thing broke
- break only when that th
On 18.4.2008, at 12.32, Andy Croll wrote:
OK I'm back and surely missing stuff again...
In my controller tests I'm checking for a redirect after a destroy
action.
First up it's a single resource ("map.resource :cart" in routes.rb)
in CartsController.rb
def destroy
@cart = Cart.find(sess
Pat Maddox wrote:
> do_delete :)
I do so love mistakes in public, don't you?
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
> it "should redirect to the previous page" do
> response.should be_redirect
> end
>
>
> Am I missing anything?
do_delete :)
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
OK I'm back and surely missing stuff again...
In my controller tests I'm checking for a redirect after a destroy
action.
First up it's a single resource ("map.resource :cart" in routes.rb)
in CartsController.rb
def destroy
@cart = Cart.find(session[:cart], :include => :items) if
session[:
On Fri, Apr 18, 2008 at 12:43 AM, Dan North <[EMAIL PROTECTED]> wrote:
> Could a pull-merge-commit before pushing have avoided this, and should we
> make that our endorsed way of working? Or am I missing something else about
> how dscm works?
I'm still fuzzy on the details of exactly what happened
Hey Matt,
The ultimate test would be one that is focused on one thing such that
the test would
- break every time that thing broke
- break only when that thing broke
- give detailed feedback enabling you to focus on the thing's
subpart necessary to identify and fix the problem
The ultimat
With mercurial I nearly did a similar thing, working on my own but
committing from two different machines. Luckily mercurial gave me a warning
that allowed me to make sense of what I was doing. Not sure how this works
with git but here goes.
1. I push from laptop1 to my central server. All is good
26 matches
Mail list logo