Re: [rspec-users] Newbie question about mock_model and should_receive....

2008-10-06 Thread Pat Maddox
Rémi Gagnon <[EMAIL PROTECTED]> writes: > Hello, > > I mocked a model and I need to test when I set for instance '000' to an > attribute 'A' that B attibute is set to ''. I don't want to stub or > mock the B(accessors) to that value cause I want to make sure my > controller will do that. > >

[rspec-users] Newbie question about mock_model and should_receive....

2008-10-06 Thread Rémi Gagnon
Hello, I mocked a model and I need to test when I set for instance '000' to an attribute 'A' that B attibute is set to ''. I don't want to stub or mock the B(accessors) to that value cause I want to make sure my controller will do that. I know its dummy question. suggestions? Rémi -- Pos

Re: [rspec-users] Newbie question, populate or ignore test db

2008-07-26 Thread Teedub
For some reason I thought I was using the fixture that thescript/ generate rspec_scaffold method created for me. And further that the fixture didn't use a database, but pretended that it did. Thanks On Jul 22, 12:09 am, Bart Zonneveld <[EMAIL PROTECTED]> wrote: > On 22-jul-2008, at 6:43, Teedub

Re: [rspec-users] Newbie question, populate or ignore test db

2008-07-22 Thread Bart Zonneveld
On 22-jul-2008, at 6:43, Teedub wrote: Thanks rake db:test:prepare did the trick. I am still a bit confused as to why rake cares about a database that it isn't using. But I guess that will all fall into place in my brain one day. Well, the test database is for ehrm, testing :). So rake is act

Re: [rspec-users] Newbie question, populate or ignore test db

2008-07-21 Thread Teedub
Thanks rake db:test:prepare did the trick. I am still a bit confused as to why rake cares about a database that it isn't using. But I guess that will all fall into place in my brain one day. Teedub On Jul 21, 1:01 am, Rahoul Baruah <[EMAIL PROTECTED]> wrote: > On 21 Jul 2008, at 08:27, David Sal

Re: [rspec-users] Newbie question, populate or ignore test db

2008-07-21 Thread Rahoul Baruah
On 21 Jul 2008, at 08:27, David Salgado wrote: If you have created it, then perhaps the test db doesn't have the right tables. So, try "rake db:test:prepare". You'll need to do that after every migration as well. Once your test database is built, using "rake spec" should ensure that your

Re: [rspec-users] Newbie question, populate or ignore test db

2008-07-21 Thread David Salgado
Have you created the database "myspec_test"? If not, try running "rake db:create:all". If you have created it, then perhaps the test db doesn't have the right tables. So, try "rake db:test:prepare". You'll need to do that after every migration as well. HTH David 2008/7/21 Teedub <[EMAIL PROTE

[rspec-users] Newbie question, populate or ignore test db

2008-07-20 Thread Teedub
Hi, I have been attempting to get rspec running on Ubuntu without much luck. I finally got it to go, but I can't figure out how to turn off the database access. I created a new test project named myspec Ran script/generate rspec and then so I would have restful routes, ran script/generate rspec_

Re: [rspec-users] Newbie question Context vs Describe

2008-02-26 Thread Pat Maddox
On Sun, Feb 24, 2008 at 6:26 AM, David Chelimsky <[EMAIL PROTECTED]> wrote: > In terms of getting that into RSpec, why don't you enter a feature > request at http://rspec.lighthouseapp.com and we can discuss the > merits of this there. As I said, I like it at first glance, but I want > to think

Re: [rspec-users] Newbie question Context vs Describe

2008-02-24 Thread Joe Ocampo
>At first glance, that is really cool. We've also batted around some >other names like #facet or #behavior. LOL..I smile because we went through the same semantic struggles as well. The funny thing is the rSpec project led us to our resolve. :-) We basically came to this conclusion every object

Re: [rspec-users] Newbie question Context vs Describe

2008-02-24 Thread David Chelimsky
On Sun, Feb 24, 2008 at 5:29 AM, Joe Ocampo <[EMAIL PROTECTED]> wrote: > Background just started programming in Ruby literally 12 hours ago and have > a question regarding context and describe methods. Reading the RDoc it > indicated that "context" is an alias for "describe". So I decided to try

[rspec-users] Newbie question Context vs Describe

2008-02-24 Thread Joe Ocampo
Background just started programming in Ruby literally 12 hours ago and have a question regarding context and describe methods. Reading the RDoc it indicated that "context" is an alias for "describe". So I decided to try to the following syntax seeing this is how I would approach it in C# with NB

Re: [rspec-users] Newbie question ...

2008-02-21 Thread Anthony Broad-Crawford
yes, thank you very much! On Feb 21, 2008, at 5:23 PM, [EMAIL PROTECTED] wrote: > On Feb 21, 10:40 am, Anthony Broad-Crawford [EMAIL PROTECTED]> wrote: >> I am testing an action on a controller and cannot seem to find the >> syntax to stub a method call off of the controller I am testing. >> >>

Re: [rspec-users] Newbie question ...

2008-02-21 Thread [EMAIL PROTECTED]
On Feb 21, 10:40 am, Anthony Broad-Crawford wrote: > I am testing an action on a controller and cannot seem to find the > syntax to stub a method call off of the controller I am testing. > > pseudo code > > class SomeController < < ApplicationController > > def some_action > >

[rspec-users] Newbie question ...

2008-02-21 Thread Anthony Broad-Crawford
I am testing an action on a controller and cannot seem to find the syntax to stub a method call off of the controller I am testing. pseudo code class SomeController < < ApplicationController def some_action stuff stuff stuff

Re: [rspec-users] Newbie question with rspec on rails

2008-02-03 Thread Pat Maddox
> What is the convention for naming and creating specs when speccing out cross > object behaviour? I missed this. For stuff like mixins, I'll generally stick the module definition under lib/ and have a corresponding spec under spec/lib. Also I usually write the spec like module NameableSpec c

Re: [rspec-users] Newbie question with rspec on rails

2008-02-03 Thread Pat Maddox
On Feb 3, 2008 9:32 AM, herding <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm just startingwith Rspec with the rails framework. > > I have a question regarding contexts. > > If I use a generator for a model, for example, user, I get a user_spec which > I can place rspec specs. > > Should I be only hav

[rspec-users] Newbie question with rspec on rails

2008-02-03 Thread herding
Hi, I'm just startingwith Rspec with the rails framework. I have a question regarding contexts. If I use a generator for a model, for example, user, I get a user_spec which I can place rspec specs. Should I be only having one file per model? What is the convention for naming and creating spec

Re: [rspec-users] Newbie question

2007-12-04 Thread Andy Goundry
cheers Tom. That worked. I'll go dig in the rspec source... On 04/12/2007, Tom Stuart <[EMAIL PROTECTED]> wrote: > > On 4 Dec 2007, at 15:41, Andy Goundry wrote: > > I've created the following spec test to simply ensure that the > > Account model receives a call to :new, but the spec is failing as

Re: [rspec-users] Newbie question

2007-12-04 Thread Tom Stuart
On 4 Dec 2007, at 15:41, Andy Goundry wrote: > I've created the following spec test to simply ensure that the > Account model receives a call to :new, but the spec is failing as it > also receives a call to :save! and it isn't expecting it. I am using > "@account = mock_model(Account)". If i

[rspec-users] Newbie question

2007-12-04 Thread Andy Goundry
Good day all :-) I am getting into RSpec and am a little confused by an aspect of mocks / mock_models in controller tests. I've gone through the online docs and the PeepCode movies and have them slightly contradictory on this matter. I hope you can clarify. Many thanks in advance :-) I'm writing

Re: [rspec-users] Newbie question

2007-11-27 Thread Pat Maddox
On 11/27/07, Pito Salas <[EMAIL PROTECTED]> wrote: > That *was* the whole file. And I think therein lies the problem. Wait, so your file had "..." in it? Yes, that would indeed be a syntax error. Pat ___ rspec-users mailing list rspec-users@rubyforge.o

Re: [rspec-users] Newbie question

2007-11-27 Thread Pito Salas
That *was* the whole file. And I think therein lies the problem. I didn't realize that I needed a class def for Acct. So this, now, works: class Account end describe Account, " when first created" do it "should have a balance of $0" do end end (as I said: newbie :) Thanks! Pito _

Re: [rspec-users] Newbie question

2007-11-27 Thread Daniel N
On Nov 28, 2007 11:58 AM, Pito Salas <[EMAIL PROTECTED]> wrote: > I installed Rspec and am getting the following failure: > > $ sudo gem install rspec > Successfully installed rspec-1.0.8 > Installing ri documentation for rspec-1.0.8... > Installing RDoc documentation for rspec-1.0.8... > > $ spec

[rspec-users] Newbie question

2007-11-27 Thread Pito Salas
I installed Rspec and am getting the following failure: $ sudo gem install rspec Successfully installed rspec-1.0.8 Installing ri documentation for rspec-1.0.8... Installing RDoc documentation for rspec-1.0.8... $ spec -v RSpec-1.0.8 (r2338) - BDD for Ruby http://rspec.rubyforge.org/ $ cat acct.