Re: [rspec-users] #add method?

2007-09-16 Thread David Chelimsky
Can you be more specific? Where have you seen such references? What did they say? Is this even an rspec question? If it's about Rails models, try the rails list. But if you do, be more specific :) On 9/16/07, David James [EMAIL PROTECTED] wrote: I've seen reference to an 'add' method, as in

Re: [rspec-users] How far to go with ActiveRecord unit tests without hitting the database?

2007-09-16 Thread Tom Stuart
On 16 Sep 2007, at 06:43, Pat Maddox wrote: You can't assign mock objects to associations. Actually I haven't had any trouble with e.g. @company = Company.new :name = 'BigCo' @mock_employee = mock_model(Employee, :name = 'Pat', :[]= = true, :save = true) @company.employees

Re: [rspec-users] rake spec:doc returns NO NAME (due to --dry-run) for each specify block

2007-09-16 Thread David Chelimsky
When you use spec:doc, it does a dry-run, in which case the blocks are never executed, in which case you get this message for every block relying on auto-generated names: describe 5 do it { 5.should == 5} end If you mean to use the specdoc format (i.e. it really runs everything and you get the

Re: [rspec-users] rake spec:doc returns NO NAME (due to --dry-run) for each specify block

2007-09-16 Thread aslak hellesoy
This happens if you have it blocks with no name. RSpec tries to generate names based on the code inside, but with dry run it isn't executed, so it can't. But maybe you don't have empty it blocks? I'm just guessing here... Aslak On 9/16/07, Christopher D. Pratt [EMAIL PROTECTED] wrote: I went

[rspec-users] I lost the RSpec fight

2007-09-16 Thread Jay Levitt
I've been working on a Rails project with one other developer; he was using Test::Unit, and I was using RSpec. That works OK for a while, but obviously it starts causing pain when you have to check in two places to see if a piece of code is properly tested/spec'd, you can't use TextMate

Re: [rspec-users] I lost the RSpec fight

2007-09-16 Thread Kevin Williams
By all means, they should not ever try anything new. The people of Earth should not have ever adopted the use of the electric light bulb or the radio or the automobile or the airplane or the microwave or the telephone or ... the Internet. No, don't adopt anything new, just stick to the old ways of

Re: [rspec-users] #add method?

2007-09-16 Thread David James
I wish I was more specific, indeed. :) While scouring the Web for examples of mocking ActiveRecord associations (see other thread), I saw the add method -- but couldn't figure out what it did. That made me wonder if it was perhaps some special construct in RSpec (perhaps for helping with

Re: [rspec-users] I lost the RSpec fight

2007-09-16 Thread Jay Levitt
On 9/16/2007 10:18 AM, Kevin Williams wrote: By all means, they should not ever try anything new. The people of Earth should not have ever adopted the use of the electric light bulb or the radio or the automobile or the airplane or the microwave or the telephone or ... the Internet. No, don't

Re: [rspec-users] I lost the RSpec fight

2007-09-16 Thread Andrew WC Brown
I honestly didn't understand what I was testing for when I was using TDD. I can't imagine starting a project without using rspec. Rspec reads much clearly and keeps me in scope. The same reason I can't imagine starting a project without ruby. Freedom is Slavery! On 9/16/07, David James [EMAIL

Re: [rspec-users] I lost the RSpec fight

2007-09-16 Thread Andrew WC Brown
You may have lost the fight, but you didn't lose the war. On 9/16/07, Andrew WC Brown [EMAIL PROTECTED] wrote: I honestly didn't understand what I was testing for when I was using TDD. I can't imagine starting a project without using rspec. Rspec reads much clearly and keeps me in scope. The

Re: [rspec-users] How far to go with ActiveRecord unit tests without hitting the database?

2007-09-16 Thread Scott Taylor
On Sep 16, 2007, at 1:20 AM, David James wrote: I'm currently try to push my limits a little bit with some of my unit testing -- trying to avoid saving ActiveRecord objects to the database and take advantage of mock/stub objects. How far should I expect to get in this direction? From

Re: [rspec-users] How I won the RSpec fight

2007-09-16 Thread Scott Taylor
On Sep 16, 2007, at 9:38 AM, Jay Levitt wrote: I've been working on a Rails project with one other developer; he was using Test::Unit, and I was using RSpec. That works OK for a while, but obviously it starts causing pain when you have to check in two places to see if a piece of code

[rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-16 Thread s.ross
While the spirit of BDD is to spec first and code second, many of us have legacy code. Worse, some of us have legacy code without very good coverage. Recognizing that *I* have such code, I created a script that grinds through your .rb files and creates placeholder specs for each public

[rspec-users] Not Implemented doesn't show

2007-09-16 Thread Andrew WC Brown
I'm going through Peepcode's Rspec Basics for an overview. He's just doing a simple spec: class PeepCode end describe PeepCode do it should be awsome do end end So running spec spec/simple_spec.rb should produce according to his screen cast: 1 example, 0 failures, 1 not implemented but I

Re: [rspec-users] Not Implemented doesn't show

2007-09-16 Thread David Chelimsky
On 9/16/07, Andrew WC Brown [EMAIL PROTECTED] wrote: I'm going through Peepcode's Rspec Basics for an overview. He's just doing a simple spec: class PeepCode end describe PeepCode do it should be awsome do end end So running spec spec/simple_spec.rb should produce according to

Re: [rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-16 Thread David Chelimsky
On 9/16/07, s.ross [EMAIL PROTECTED] wrote: While the spirit of BDD is to spec first and code second, many of us have legacy code. Worse, some of us have legacy code without very good coverage. Recognizing that *I* have such code, I created a script that grinds through your .rb files and

Re: [rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-16 Thread Pat Maddox
On 9/16/07, s.ross [EMAIL PROTECTED] wrote: While the spirit of BDD is to spec first and code second, many of us have legacy code. Worse, some of us have legacy code without very good coverage. Recognizing that *I* have such code, I created a script that grinds through your .rb files and

Re: [rspec-users] Not Implemented doesn't show

2007-09-16 Thread Andrew WC Brown
Oh, he removed the block. describe PeepCode do it should be awsome do end end describe PeepCode do it should be awsome end I'm still haven't solved --format with specing. On 9/16/07, David Chelimsky [EMAIL PROTECTED] wrote: On 9/16/07, Andrew WC Brown [EMAIL PROTECTED] wrote: I'm

Re: [rspec-users] Not Implemented doesn't show

2007-09-16 Thread Andrew WC Brown
Both Solved, User Error =P On 9/16/07, Andrew WC Brown [EMAIL PROTECTED] wrote: Oh, he removed the block. describe PeepCode do it should be awsome do end end describe PeepCode do it should be awsome end I'm still haven't solved --format with specing. On 9/16/07, David

Re: [rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-16 Thread Pat Maddox
On 9/16/07, Scott Taylor [EMAIL PROTECTED] wrote: On Sep 16, 2007, at 3:04 PM, David Chelimsky wrote: On 9/16/07, s.ross [EMAIL PROTECTED] wrote: While the spirit of BDD is to spec first and code second, many of us have legacy code. Worse, some of us have legacy code without very good

Re: [rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-16 Thread s.ross
As with all development tools, caveat programmer. The art is in recognizing the behaviors and not just exercising the methods meaninglessly. I personally believe that having the method tests in spec form allows me to think about what the methods are *doing* and then write the real behavior

[rspec-users] how do I get the beautiful html rspec results in textmate?

2007-09-16 Thread Andrew WC Brown
I'm going through PeepCode RSpec Basics and he gets a beautiful rspec results page in html when he presses a hotkey in TextMate. I would guess it's along the lines of Apple + R but I don't get the same results and I'm using the same bundle. ___

Re: [rspec-users] how do I get the beautiful html rspec results in textmate?

2007-09-16 Thread Scott Taylor
On Sep 16, 2007, at 9:43 PM, Andrew WC Brown wrote: I'm going through PeepCode RSpec Basics and he gets a beautiful rspec results page in html when he presses a hotkey in TextMate. I would guess it's along the lines of Apple + R but I don't get the same results and I'm using the same

Re: [rspec-users] rake spec:doc returns NO NAME (due to --dry-run) for each specify block

2007-09-16 Thread Christopher D. Pratt
Thanks for all the responses. Unfortunately, I apparently just like being difficult. Tom: I installed the new version of rspec on a fresh app, so the first run of script/generate rspec was from the trunk version ... good idea though, because it sounds like something I would have done -

Re: [rspec-users] [ANN] rspec_todo -- spec'ing backwards

2007-09-16 Thread lancecarlson
Yes that is nice because you know what files aren't really being used. That is asiming you tested everything that is being used! Sent via BlackBerry from T-Mobile -Original Message- From: Scott Taylor [EMAIL PROTECTED] Date: Sun, 16 Sep 2007 15:45:34 To:rspec-users