Re: [rspec-users] stub in config.before

2011-08-14 Thread John Hinnegan
On Sun, Aug 14, 2011 at 3:48 PM, John Hinnegan wrote: > >> >> >> I was trying to stub something "globally", across all tests today, and had >> some trouble. >> >> I tried >> >> RSpec.configure do |config| >> config.before(:all

Re: [rspec-users] stub in config.before

2011-08-14 Thread John Hinnegan
Thanks, cheers On Sun, Aug 14, 2011 at 8:17 PM, David Chelimsky wrote: > On Aug 14, 2011, at 10:15 PM, Justin Ko wrote: > > On Sun, Aug 14, 2011 at 3:48 PM, John Hinnegan wrote: > >> >> >> I was trying to stub something "globally", across all tests today

[rspec-users] stub in config.before

2011-08-14 Thread John Hinnegan
I was trying to stub something "globally", across all tests today, and had some trouble. I tried RSpec.configure do |config| config.before(:all) do MyClass.stub(:my_method) end end seems that stub is not available here yet. (I was stubbing a class method, and the class was loaded correc

[rspec-users] How can I make before/after all a method?

2011-07-29 Thread John Hinnegan
I would like to turn this: describe TestClass do before :all do # set some config end after :all do # restore some config end # do a bunch of tests to this end into describe TestClass do with_config_value(X) # do a bunch of tests to this end Basically, I want to include before :all and after

[rspec-users] does anyone's rspec actually exit on the first ^C?

2011-07-29 Thread John Hinnegan
So, you start running your (full and long) rspec suite (before a checkin), and you realize you [forgot to migrate test|didn't add some config value|missed a curly brace]. You hit Ctrl+C and get this mesage Exiting... Interrupt again to exit immediately. Then the tests march on. My question is, do

[rspec-users] Caching in Rails by Default

2011-07-02 Thread John Hinnegan
So, maybe I need to go to the rails list with this, but I hit my error while testing so I figured I'd ask here first. Basically, Rails.cache.fetch is being persisted by default in my rails project between rspec runs. I've illustrated what I'm observing here: https://github.com/softwaregravy/rspe

[rspec-users] can't access route variables

2011-07-02 Thread John Hinnegan
I'm testing methods in my ApplicationController using anonymous controller class (not sure if that's relevant). I've somehow broken something such that I do not have access to the routing variables that rails generates. So rather than having something like 'response.should redirect_to new_user_se