Re: [rspec-users] Rspec on rails with out database?

2007-07-27 Thread barsalou
Quoting David Chelimsky <[EMAIL PROTECTED]>: > On 7/27/07, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On 7/27/07, David Chelimsky <[EMAIL PROTECTED]> wrote: >> > On 7/24/07, Eric Pugh <[EMAIL PROTECTED]> wrote: >> > > Hi all, >> > > >> > > I am trying to use rspec_on_rails in a Rails app that d

Re: [rspec-users] Rspec on rails with out database?

2007-07-27 Thread David Chelimsky
On 7/27/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 7/27/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On 7/24/07, Eric Pugh <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > > > I am trying to use rspec_on_rails in a Rails app that doesn't have a > > > database. so far I have just bee

Re: [rspec-users] Rspec on rails with out database?

2007-07-27 Thread David Chelimsky
On 7/27/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 7/24/07, Eric Pugh <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I am trying to use rspec_on_rails in a Rails app that doesn't have a > > database. so far I have just been faking it out by dumping in a > > sqlite3 database just to make R

Re: [rspec-users] Rspec on rails with out database?

2007-07-27 Thread David Chelimsky
On 7/24/07, Eric Pugh <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to use rspec_on_rails in a Rails app that doesn't have a > database. so far I have just been faking it out by dumping in a > sqlite3 database just to make Rails happy. Try deleting config/database.yml (or renaming it to so

Re: [rspec-users] Coding standards and whitespace

2007-07-27 Thread David Chelimsky
On 7/26/07, Wincent Colaiuta <[EMAIL PROTECTED]> wrote: > Recently as a result of using Git I've noticed a number of > inconsistencies in the RSpec codebase with respect to whitespace > (mixed line endings, mixed use of spaces and tabs for indentation, > and trailing whitespace at the end of lines)

Re: [rspec-users] Mocking Access Control

2007-07-27 Thread Courtenay
On 7/27/07, Justin Williams <[EMAIL PROTECTED]> wrote: > Thanks for the help. > You're welcome > I think I'm getting closer. I'm still not getting a redirect. I > still think it's the same reason though. I say this because when I > modify the last line of my spec to be render_template("index")

Re: [rspec-users] Mocking Access Control

2007-07-27 Thread Justin Williams
Thanks for the help. I think I'm getting closer. I'm still not getting a redirect. I still think it's the same reason though. I say this because when I modify the last line of my spec to be render_template("index") instead of redirect, it says that it renders the login template. Am I putting t

Re: [rspec-users] autotest doesn't notice file changes

2007-07-27 Thread David Chelimsky
On 7/27/07, Ingo Weiss <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to use autotest with rspec and rais, and it seems to work > fine when I run autotest -rails initially, but then autotest fails to > recognize file changes and run tests continuously. Did I skip a step? > Here is my setup: >

[rspec-users] autotest doesn't notice file changes

2007-07-27 Thread Ingo Weiss
Hi all, I am trying to use autotest with rspec and rais, and it seems to work fine when I run autotest -rails initially, but then autotest fails to recognize file changes and run tests continuously. Did I skip a step? Here is my setup: rails v1.2.3 rspec plugin v1.0.5 rspec_on_rails plugin

Re: [rspec-users] File.stub!

2007-07-27 Thread David Chelimsky
On 7/27/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I've answered my own question. I changed before :all do; to just before > do (which is the same as before :each do) and everything works fine. I'm > not overly concerned that stubbing has to occur prior to each example > method, but

Re: [rspec-users] Spec for validation plugin

2007-07-27 Thread rob_twf
rob_twf wrote: > > > it "should validate that the postcode is correctly formatted" do > > Location.should_receive(:validates_as_uk_postcode).once.with(:post_code) > load Location.source_file > end > > That works nicely. > > Looks like I was a bit eager. Loading the class in th

Re: [rspec-users] Spec for validation plugin

2007-07-27 Thread rob_twf
David Chelimsky-2 wrote: > > > Here are some interesting thoughts on that: > > http://blog.jayfields.com/2006/12/rails-unit-testing-activerecord.html > > Just apply the same thinking to rspec. > > Thanks for the pointer, here's what I've done: In spec_helper.rb: class << ActiveRecord::Ba

Re: [rspec-users] MockCov: Proof of concept

2007-07-27 Thread Ian Leitch
Sure. Say I have Class A and to test it, Spec B. From a quick look at Spec B I'm able to read the 'when' and 'should' descriptions and get a rough idea what the spec covers, yet nothing detailed, to do that I'd have to read the Class and Spec in conjunction, even still, it may not be obvious if a

Re: [rspec-users] MockCov: Proof of concept

2007-07-27 Thread Ian Leitch
Yeah, only RSpec at the moment, I haven't looked into integrating it with any of the others. The way it does its magic is tightly coupled with RSpecs design, specifically the metaclass proxies. Other frameworks may use the same approach, I don't know. It can't really be integrated with RCov for th

Re: [rspec-users] File.stub!

2007-07-27 Thread tim.watson
Hi, I've answered my own question. I changed before :all do; to just before do (which is the same as before :each do) and everything works fine. I'm not overly concerned that stubbing has to occur prior to each example method, but why is this the case? If this behaviour is intended (which I'm gues

Re: [rspec-users] File.stub!

2007-07-27 Thread tim.watson
Hi, I'm trying to stub File.open and whenever I do, rspec blows up with the following error message (undefined method `add' for nil:NilClass), which seems to happen because method __add in class Proxy is calling #add on global $rspec_mocks, which in turn is nil. Can someone explain what I'm doi