[rspec-users] simple == with prettier error messages + good documentation

2009-01-29 Thread r_j_h_box-sf
Hi all, I've found myself writing a thing I think is less than optimal, looking for suggestions. The context is, I'm testing a result, and as a part of that test, I might verify two or three things, which are individually relevant but not really discrete results (?). Here's my thinking proce

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-29 Thread r_j_h_box-sf
I'm starting to wonder if this is a good idea to begin with. I had started to suggest nested it()s: it "..." do it "something more" do end end ... but it's already handled by the existing nested describe(), before(), it() system. I guess if we were shooting for flexibility, we might as

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-29 Thread r_j_h_box-sf
I do like try_to do...end.or_report - much better for the case where I'm not trying to generate documentation. I'm not sure it works so well for the case where I want to generate an extra element of documentation, though this might be just an implementation detail. .or_report .or_document .or_

Re: [rspec-users] simple == with prettier error messages + good documentation

2009-01-31 Thread r_j_h_box-sf
Passing the it() and describe() args through to the reporting layer sounds like a great idea. I've thought more about the reporting-levels approach. The numeric as I postulated earlier is probably not the most useful thing. As a product manager, I want to be able to flexibly present the appr

[rspec-users] resource urls only work *after* a get() in controller spec

2009-01-31 Thread r_j_h_box-sf
I'm encountering an interesting symptom during example execution. I'm making a shared example group that dries up belongs-to-me before_filter testing, and it makes a callback to the example group that says it_should_behave_like that. The callback tells the shared example where to expect a redire

Re: [rspec-users] resource urls only work *after* a get() in controller spec

2009-02-01 Thread r_j_h_box-sf
thanks, Ben - that didn't do the trick, though. I traced it down as far as this: the controller hasn't initialized its current url - that's the immediate cause of the method-on-nil complaint. It hasn't, because the controller isn't technically handling a request yet (i.e., process()). I trie

Re: [rspec-users] resource urls only work *after* a get() in controller spec

2009-02-01 Thread r_j_h_box-sf
Okay, following up on this item. Would you believe a workaround of (gasp) get :index, prior to expecting route-based URLs to work? (slaps forehead). or do_action(), provided by the host example group (the more concrete example group, I mean - what's the right terminology there?). I tried repro

Re: [rspec-users] [Cucumber] Cucumber and acts_as_xapian

2009-02-02 Thread r_j_h_box-sf
A question for edumacational purposes here: Instead of disabling transactions, would it be effective to include all the steps of inserting the record and running the search, inside one scenario? Given [the record is added to the database" When [I search for it] Then [I should find it] If this

Re: [rspec-users] resource urls only work *after* a get() in controller spec

2009-02-10 Thread r_j_h_box-sf
Done: http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/692-route-based-_url-or-_path-functions-dont-work-until-getpost-are-called Randy - Original Message > From: David Chelimsky > To: rspec-users > Sent: Tuesday, February 10, 2009 12:15:48 PM > Subject: Re: [rspec-users]

[rspec-users] [cucumber] can't use 'visit' except with `rake features`

2009-02-15 Thread r_j_h_box-sf
I ported some stories from restful_authentication so that they can use cucumber, and it worked fine in `rake features`. Now when I try to run under autospec or `cucumber features`, I'm getting failures with undefined method `get'. When I change 'get' to 'visit', same symptom (undefined method

Re: [rspec-users] [cucumber] can't use 'visit' except with `rake features`

2009-02-15 Thread r_j_h_box-sf
I'm running it like so: $ cucumber features/ I've also tried using --require config/boot.rb --require features --require config/environment.rb and now, I've tried with --require lib --require features features/ (nope) --require features --require lib features/ (yes!) Shazyam

Re: [rspec-users] [rails] An authorization question

2009-03-02 Thread r_j_h_box-sf
- Original Message > From: James Byrne > Mark Wilden wrote: > > Actually, it's the other way around. > > > > http://www.pragprog.com/articles/tell-dont-ask > > I have read this article and it leaves me rather more confused than not. That's the danger of oversimplification. Anoth

Re: [rspec-users] where does cucumber.yml live?

2009-03-05 Thread r_j_h_box-sf
- Original Message > From: John Small [David:] > > In the project root (or wherever you're typing commands from). > Is this documented anywhere, or are people expected to just know it? I added the information to the wiki in one or two places, having been bitten by the same expecta

Re: [rspec-users] where does cucumber.yml live?

2009-03-05 Thread r_j_h_box-sf
Aslak: > some gmail lag issue going on here? Not sure who's causing the lag, but yeah. My hope was to help in a way that I could, freeing the "big guns" to focus on things I'm less suited for at this moment. Randy ___ rspec-users mailing list rspec

Re: [rspec-users] [Cucumber] Tables

2009-04-22 Thread r_j_h_box-sf
From: aslak hellesoy > Here is an alternative: http://gist.github.com/99376 I'm a fan of simple, which means I'm a fan of this. The only thing I can think of that would be simpler is this: * When the arity of the matcher is larger by one than the match

Re: [rspec-users] [RSpec] Clarification on using shared_examples_for on a Rails Controller

2009-04-22 Thread r_j_h_box-sf
- Original Message > From: David Chelimsky > Shared examples don't support parameterization, but macros do. Try > something like this: > > module Macros > def shows_yearly_archive_for(requests={}) [...] > end > end > > describe SomeController do > extend Macros > shows_yearl

Re: [rspec-users] Problem verifying routing error

2009-06-16 Thread r_j_h_box-sf
I finally figured this out. lambda { route_for(:controller => "designs", :action => "create").should == "anything" }.should raise_error( ActionController::RoutingError ) The clue was that I wasn't getting a routing error until I tried to compare route_for() with something. route_for() seems t

Re: [rspec-users] Problem verifying routing error

2009-06-16 Thread r_j_h_box-sf
David, thank you for your reply on this. I really dig the expect { }.to raise_error() syntax!! To clarify: All the things you're claiming match my expectation. Unfortunately, my expectation does not match reality according to my tests. The thing is, route_for([bad stuff]) does not in and of

Re: [rspec-users] Problem verifying routing error

2009-06-16 Thread r_j_h_box-sf
Here's another interesting symptom. After tracing through the code, I've come to the understanding that the current implementation (delegated to outside rspec, I understand) of route "generation" is not testing generation at all, but rather is using backward-recognition as a proxy. Further, t

Re: [rspec-users] Problem verifying routing error

2009-06-17 Thread r_j_h_box-sf
Okay, after such a harsh analysis of the problem, I figured it was worth digging in just a little bit more. Side note, some of what I was seeing yesterday was a by-product of having default routes still existing. But there are still some essential facts that remain, which I present here. 1.

Re: [rspec-users] Stubbing out Time correctly

2009-07-13 Thread r_j_h_box-sf
> >From: Adam Anderson > >Would using this kind of technique require me to use that intention-revealing >method to be used in place of Time.now everywhere in the app? That is what it >seems like to me and if that's the case then I couldn't see myself doing a >Find/Replace across the entire a

Re: [rspec-users] How should you make sure the user is not authenticated

2009-07-28 Thread r_j_h_box-sf
- Original Message > From: Matt Wynne > Don't forget the session is thrown away for each scenario, so if you're > starting > a new scenario you wont' be logged in, by default. I wonder if that is true also when Webrat/Selenium or Celerity is involved? Randy _