Re: [rspec-users] Pretty story output for non-Rails project

2008-03-03 Thread Aslak Hellesøy
Like David said. Not working for you? Aslak On Mar 4, 2008, at 8:03, "s.ross" <[EMAIL PROTECTED]> wrote: > On Mar 3, 2008, at 10:19 PM, David Chelimsky wrote: > >> In the mean time, you >> can do it on the command line with --format html and open the >> resulting file in a browser. > > Er... sto

Re: [rspec-users] Pretty story output for non-Rails project

2008-03-03 Thread s.ross
On Mar 3, 2008, at 10:19 PM, David Chelimsky wrote: > In the mean time, you > can do it on the command line with --format html and open the > resulting file in a browser. Er... stories? How do you format story output as html? ___ rspec-users mailing lis

Re: [rspec-users] rspec controller action list

2008-03-03 Thread Namrata Tiwari
Followed your example! Still getting the following error - Spec::Mocks::MockExpectationError in 'ArticlesController should list all article s' Mock 'ArticlesController' expected :find_city with (any args) once, but received it 0 times spec/controllers/articles_controller_spec.rb:3: Thanks, Namr

Re: [rspec-users] Pretty story output for non-Rails project

2008-03-03 Thread David Chelimsky
On Mon, Mar 3, 2008 at 11:41 PM, George Anderson <[EMAIL PROTECTED]> wrote: > I'm taking my first fledgling steps driving a new ruby (non-rails) > project with BDD. I've got a (test) story working. However, when I > run the story in TextMate (via command-r), the output is plain text. > > See:

[rspec-users] Pretty story output for non-Rails project

2008-03-03 Thread George Anderson
I'm taking my first fledgling steps driving a new ruby (non-rails) project with BDD. I've got a (test) story working. However, when I run the story in TextMate (via command-r), the output is plain text. See: http://skitch.com/georgeanderson/8grg/run-examples How do I get the output to look pret

Re: [rspec-users] rspec controller action list

2008-03-03 Thread David Chelimsky
On Mon, Mar 3, 2008 at 11:21 PM, Namrata Tiwari <[EMAIL PROTECTED]> wrote: > Here is the action - > > def list > @articles = find_city.articles.paginate :all, :page => > params[:page] , :order => "live_on DESC", :conditions => { :type_for > => "blog" } > end > > and the spec - > > it

Re: [rspec-users] rspec controller action list

2008-03-03 Thread Namrata Tiwari
Here is the action - def list @articles = find_city.articles.paginate :all, :page => params[:page] , :order => "live_on DESC", :conditions => { :type_for => "blog" } end and the spec - it "should list all articles 2" do articles = mock("articles") get :list controller.shou

Re: [rspec-users] Matchers tutorial ...

2008-03-03 Thread Anthony Broad-Crawford
thank you! On Mar 3, 2008, at 10:46 PM, David Chelimsky wrote: > On Mon, Mar 3, 2008 at 9:42 PM, Anthony Broad-Crawford > <[EMAIL PROTECTED]> wrote: >> I am looking for a good a - z matchers tutorial . Anyone got a url >> for one? > > There are many. Here's mine: > http://blog.davidchelimsky.n

Re: [rspec-users] Matchers tutorial ...

2008-03-03 Thread David Chelimsky
On Mon, Mar 3, 2008 at 9:42 PM, Anthony Broad-Crawford <[EMAIL PROTECTED]> wrote: > I am looking for a good a - z matchers tutorial . Anyone got a url for one? There are many. Here's mine: http://blog.davidchelimsky.net/articles/2007/02/18/custom-expectation-matchers > > Thanks > > > Anthony Bro

[rspec-users] Matchers tutorial ...

2008-03-03 Thread Anthony Broad-Crawford
I am looking for a good a - z matchers tutorial . Anyone got a url for one? Thanks Anthony Broad-Crawford ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing Plugins + Lib Code

2008-03-03 Thread Pat Maddox
On Mon, Mar 3, 2008 at 3:17 PM, Mark Dodwell <[EMAIL PROTECTED]> wrote: > Hi, > > I'm quite new to Rspec and I'm embarking on a new project. One thing I'm > really not sure about is how to test plugins and code in your 'lib/' > folder. Where would these specs actually live in the dir structure?

[rspec-users] stuck on testing validation

2008-03-03 Thread Oliver Barnes
Hello, I must be doing something dumb, but here it goes... why does this work? before(:each) do @work = Work.new end #for testing validates_presence_of :title it "should require a title" do @work.title = nil @work.should_not be_valid end while this doesn't: def valid_w

[rspec-users] Testing Plugins + Lib Code

2008-03-03 Thread Mark Dodwell
Hi, I'm quite new to Rspec and I'm embarking on a new project. One thing I'm really not sure about is how to test plugins and code in your 'lib/' folder. Where would these specs actually live in the dir structure? Should you test plugins by creating specs within the plugin's dir? Or by adding a s

Re: [rspec-users] Rspec and plugins

2008-03-03 Thread Matthias Hennemeyer
I would prefer two independent steps: 1) Specify (or test) the plugin so that you can trust that it works as intended. 2) Write a custom matcher (behave_in_a_cool_way) that lets you express that you want to have added some_cool_behavior to SomeModel: describe SomeModel it "should show so

[rspec-users] Rspec and plugins

2008-03-03 Thread Anthony Broad-Crawford
I have a question regarding best practices around module and plugin testing for rails applications. In our application we have created several plugins that extend ActiveRecord::Base with class methods, that when invoked in a model add behavior to that model. For example ... class SomeMo

Re: [rspec-users] rspec controller action list

2008-03-03 Thread David Chelimsky
On Mon, Mar 3, 2008 at 5:22 AM, Namrata Tiwari <[EMAIL PROTECTED]> wrote: > > > > > If the code is the same as it was in the first post in this thread, > > it's because the action is taking place before setting the > > expectations. > > Yes, it is the same. As you have suggested earlier. > I

Re: [rspec-users] rspec controller action list

2008-03-03 Thread Namrata Tiwari
> > If the code is the same as it was in the first post in this thread, > it's because the action is taking place before setting the > expectations. Yes, it is the same. As you have suggested earlier. I am pasting the spec again. #list it "should list all articles" do articles = mock("art

Re: [rspec-users] rspec controller action list

2008-03-03 Thread David Chelimsky
On Mon, Mar 3, 2008 at 5:04 AM, Namrata Tiwari <[EMAIL PROTECTED]> wrote: > Matthias Hennemeyer wrote: > > Am 03.03.2008 um 04:38 schrieb Namrata Tiwari: > > > >> The method find_city is in application controller. I think the method > >> 'find_city' is being called but its expecting some args.

Re: [rspec-users] rspec controller action list

2008-03-03 Thread Namrata Tiwari
Matthias Hennemeyer wrote: > Am 03.03.2008 um 04:38 schrieb Namrata Tiwari: > >> The method find_city is in application controller. I think the method >> 'find_city' is being called but its expecting some args. >> > The message: > > Mock 'ArticlesController' expected :find_city with (any args) on

Re: [rspec-users] rspec controller action list

2008-03-03 Thread Matthias Hennemeyer
Am 03.03.2008 um 04:38 schrieb Namrata Tiwari: > The method find_city is in application controller. I think the method > 'find_city' is being called but its expecting some args. > The message: Mock 'ArticlesController' expected :find_city with (any args) once, but received it 0 times means th

Re: [rspec-users] outside-in = integration tests on views?

2008-03-03 Thread Rob Holland
> BTW, Are the PeepCode rSpec tutorials worth buying? Anything from PeepCode is worth buying imho, but the specifically, the three rspec ones I have watched have been excellent. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/