Re: [rspec-users] [rspec] loading specs as an object model without running them

2009-04-28 Thread Matt Wynne
On 29 Apr 2009, at 07:23, Marty Andrews wrote: I'd like to load all of my examples into memory without actually running them, so I can traverse the object tree and get descriptions etc. I'm finding it tricky to figure out how to do that though. There seems to be an inherent assumption in the f

[rspec-users] [rspec] loading specs as an object model without running them

2009-04-28 Thread Marty Andrews
I'd like to load all of my examples into memory without actually running them, so I can traverse the object tree and get descriptions etc.  I'm finding it tricky to figure out how to do that though. There seems to be an inherent assumption in the framework that that examples will actually run. So

Re: [rspec-users] BDD for C#?

2009-04-28 Thread aslak hellesoy
> > > On Sun, Apr 26, 2009 at 6:32 AM, aslak hellesoy > wrote: > >> >> I recently added pure java support to Cucumber, meaning steps can be >> written in Java instead of Ruby. >> http://github.com/aslakhellesoy/cucumber_java/tree/master >> > > > and I've been introducing a java team to real storyt

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread aslak hellesoy
> Hey Ben, > > It'd be kinda cool if there was a sort of before and after for a feature > rather than each scenario. Is there? > I think that would be particularly *un*cool actually, because people would start using it without understanding the implications. Implications: Coupled, brittle scenario

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Ben Mabey
Julian Leviston wrote: Hey Ben, It'd be kinda cool if there was a sort of before and after for a feature rather than each scenario. Is there? Nope. There is no before(:all) equivalent in cucumber. Just the Before and After hooks, which are for scenarios.. and Backgrounds which are just fo

Re: [rspec-users] cucumber/webrat, need to set user in session, can't stub or mock. Fixtures?

2009-04-28 Thread Chris Flipse
I have a subapp that authenticates remotely, and pulls information from the main app using ActiveResource, and a token provided in a cookie, which sounds at least close to what you're trying to test While it's possible to stub the values coming back, it can be tricky. By definition, you pretty mu

Re: [rspec-users] Current Evaluation of RSpec

2009-04-28 Thread Stephen Eley
On Tue, Apr 28, 2009 at 10:57 PM, Nicholas Van Weerdenburg wrote: > Looking around outside of the book, reading reviews of RSpec on the web > seems tricky. Most reviews seem very dated, and as a result are misleading. > Is this an accurate assessment? I don't think so. The core syntax and sensib

Re: [rspec-users] BDD for C#?

2009-04-28 Thread John Goodsen
On Sun, Apr 26, 2009 at 6:32 AM, aslak hellesoy wrote: > > I recently added pure java support to Cucumber, meaning steps can be > written in Java instead of Ruby. > http://github.com/aslakhellesoy/cucumber_java/tree/master > and I've been introducing a java team to real storytest driven developm

[rspec-users] Current Evaluation of RSpec

2009-04-28 Thread Nicholas Van Weerdenburg
I'm new to RSpec and reading the beta book. Looking around outside of the book, reading reviews of RSpec on the web seems tricky. Most reviews seem very dated, and as a result are misleading. Is this an accurate assessment? The big changes I've gleaned are contexts and macros and the rapid growth

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Ben Mabey
Arco wrote: Thanks for your reply Ben. +1 on your wording recommendation - I understand and agree 100% However - for me - the Background block executes before each example in the table. Therefore, the database is cleared twice, and the second example ('duplicate userid') fails. (Cucumber 0.3.

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Julian Leviston
Hey Ben, It'd be kinda cool if there was a sort of before and after for a feature rather than each scenario. Is there? (Rails context) We often need this. It'd be really helpful for things like when we want to test about 15 things on a particular web page, and they don't require fresh dat

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Kero van Gelder
> I'd like to do this: > > Feature: user signup > Before: > Given I have a cleaned up database > Scenario Outline: Sign Up > Given I am on the signup page > When I sign up using > Then I should see >Examples: > |userid |message | > |userX |suc

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Arco
Thanks for your reply Ben. +1 on your wording recommendation - I understand and agree 100% However - for me - the Background block executes before each example in the table. Therefore, the database is cleared twice, and the second example ('duplicate userid') fails. (Cucumber 0.3.1 / ruby 1.8.7

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Ben Mabey
Arco wrote: I'd like to do this: Feature: user signup Before: Given I have a cleaned up database Scenario Outline: Sign Up Given I am on the signup page When I sign up using Then I should see Examples: |userid |message | |userX |successful si

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Arco
I'd like to do this: Feature: user signup Before: Given I have a cleaned up database Scenario Outline: Sign Up Given I am on the signup page When I sign up using Then I should see Examples: |userid |message | |userX |successful signup | |us

[rspec-users] Noob question

2009-04-28 Thread Sophie (itsme213)
Just getting started with cucumber on Mac 10.5.6. I have the default Ruby install (1.8). I'm not using Rails. I did a gem update cucumber and now have cucumber-0.3.1 in my gems. I also did a git clone and have a repo with cucumber 0.3.2. When I cd into my cucumber (git) directory and do: c

Re: [rspec-users] uninitialized constant ActionController running Cucumber features in Aptana/RadRails IDE

2009-04-28 Thread WJSimacek
I uninstalled rails-2.3.1 and rails-2.3.2 and then Successfully installed rails-2.3.2 ==>Same error message I think I'm going to try and lose the eclipse framework next. Just another layer giving me a headache. Thanks for your help, Wayne On Apr 27, 4:46 pm, aslak hellesoy wrote: > > I'm just

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread aslak hellesoy
On Tue, Apr 28, 2009 at 6:15 PM, Arco wrote: > OK - I found a workaround. I simply tag the first scenario with > '@first', then > do Before('@first') and i get what I want - executing a block once for > the feature file. > > Except for one problem: most of my scenarios are done as scenario > ou

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Arco
OK - I found a workaround. I simply tag the first scenario with '@first', then do Before('@first') and i get what I want - executing a block once for the feature file. Except for one problem: most of my scenarios are done as scenario outlines, which are run multiple times - once for each row of

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread aslak hellesoy
On Tue, Apr 28, 2009 at 5:32 PM, Arco wrote: > I also would like a hook that executes a block once before running a > feature file. > > In my testing i found that: > - Background: executes before each scenario > - Before executes before each scenario > - Before('@tag') executes before each scenar

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Arco
I also would like a hook that executes a block once before running a feature file. In my testing i found that: - Background: executes before each scenario - Before executes before each scenario - Before('@tag') executes before each scenario Is there a way to execute a block once before each featu

Re: [rspec-users] Cucumber - Testing ActionMailer

2009-04-28 Thread James Byrne
I have reached this point in testing using email-spec: The code: # Format and email the results. if fx_hash_array send_to = 'em...@example.com' MailerPublic.deliver_forex_daily_notice!(send_to,fx_hash_array) ActionMailer::Base.deliveries.each { |m| puts m } unless Rails.env.production? end

Re: [rspec-users] [Cucumber] call the (Treetop?) parser directly?

2009-04-28 Thread David Chelimsky
On Tue, Apr 28, 2009 at 8:56 AM, Phlip wrote: > Bump? > >>> Please explain how it doesn't work. Output, error etc. >> >> Same as before: > > I also get it from a rspec-rails case... Huh? What does this have to do w/ rspec-rails? This thread is about a NameError on _nt_scenario_outline_keyword. __

Re: [rspec-users] [cucumber] Use of Scenario Outline for validation stuff ?

2009-04-28 Thread Mark Wilden
On Tue, Apr 28, 2009 at 2:11 AM, Jérémy Kaz wrote: > Given I am logged in as a SuperAdmin user > When I go to the VATs page > And I follow "New VAT" > And I fill in "vat_caption" with "" > And I fill in "vat_value" with "" > And I press "Créer" > Then I should see "" > And the VAT "" should be p

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread aslak hellesoy
> Hi -- is it possible to set before and after blocks for individual feature > files? Yes. Use tagged hooks: http://wiki.github.com/aslakhellesoy/cucumber/hooks Aslak > > I've tried putting them in step files, but they just get called before > everything, like they'd been declared in env.rb, w

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread doug livesey
Brilliant, cheers! Doug. 2009/4/28 Julian Leviston > Perhaps use background? > > Julian. > > > > On 28/04/2009, at 10:18 PM, doug livesey wrote: > > Hi -- is it possible to set before and after blocks for individual feature >> files? >> I've tried putting them in step files, but they just ge

Re: [rspec-users] [Cucumber] call the (Treetop?) parser directly?

2009-04-28 Thread aslak hellesoy
Bump? On Sun, Apr 26, 2009 at 5:04 PM, aslak hellesoy wrote: > On Sat, Apr 25, 2009 at 5:00 PM, Phlip wrote: > > Aslak Hellesøy wrote: > > > >>> require File.dirname(__FILE__) + '/../test_helper' > >>> > >>> class CukeFeatureParser < ActiveSupport::TestCase > >>> > >>> def test_parser > >>> > >

Re: [rspec-users] [Cucumber] call the (Treetop?) parser directly?

2009-04-28 Thread Phlip
Bump? Please explain how it doesn't work. Output, error etc. Same as before: I also get it from a rspec-rails case... ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Cucumber - Testing ActionMailer

2009-04-28 Thread James Byrne
Ben Mabey wrote: > Sorry, I couldn't be of any help. > Actually, you were a great help, but on a different thread. The reason I was not seeing anything is that the default environment is "development" and I have things configured so that the deliveries array is only used in "test". Adding

Re: [rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread Julian Leviston
Perhaps use background? Julian. On 28/04/2009, at 10:18 PM, doug livesey wrote: Hi -- is it possible to set before and after blocks for individual feature files? I've tried putting them in step files, but they just get called before everything, like they'd been declared in env.rb, which is

Re: [rspec-users] [rspec] be_something accepts nils

2009-04-28 Thread Ashley Moran
On 13 Mar 2009, at 16:34, Matt Wynne wrote: Like yoda sounds, that does Been implemented properly, it has :) http://blog.zenspider.com/2009/04/spec-yoda-will.html -- http://www.patchspace.co.uk/ http://www.linkedin.com/in/ashleymoran http://aviewfromafar.net/ http://twitter.com/ashleymoran

[rspec-users] Before and After blocks for individual feature files?

2009-04-28 Thread doug livesey
Hi -- is it possible to set before and after blocks for individual feature files? I've tried putting them in step files, but they just get called before everything, like they'd been declared in env.rb, which is consistent with how I thought cucumber worked, but I thought I'd best try it anyway. Any

Re: [rspec-users] cucumber/webrat, need to set user in session, can't stub or mock. Fixtures?

2009-04-28 Thread doug livesey
Further to this, here is what I am currently doing. I installed the seed-fu plugin and wrote a method in my env.rb file like this: # # Load fixtures by tableised names. # def seed_fixtures( *fixtures ) ActiveRecord::Base.establish_connection( ActiveRecord::Base.configurations['test'] ) ActiveR

Re: [rspec-users] [cucumber] Use of Scenario Outline for validation stuff ?

2009-04-28 Thread Jérémy Kaz
Aslak Hellesøy wrote: >> Sorry about bad formating, I pasted it and haven't checked ... >> >> Well, you may have understood that the "<" thing is pointing to the >> 'And the VAT "" ...' line, the 1st col of 2nd line in the >> examples is a blank one, and the last line is cut into 2 > > > Sorr

Re: [rspec-users] [cucumber] Use of Scenario Outline for validation stuff ?

2009-04-28 Thread aslak hellesoy
On Tue, Apr 28, 2009 at 11:11 AM, Jérémy Kaz wrote: > Hi there ! > I was wondering if the way I test the validation of my forms is right or > not. So here's a little example : > Imagine you have a form with some validations designed to create some > object. You want to test it using Scenario Outl

Re: [rspec-users] [cucumber] Use of Scenario Outline for validation stuff ?

2009-04-28 Thread aslak hellesoy
> Sorry about bad formating, I pasted it and haven't checked ... > > Well, you may have understood that the "<" thing is pointing to the > 'And the VAT "" ...' line, the 1st col of 2nd line in the > examples is a blank one, and the last line is cut into 2 Sorry, I'm a little lost here. Was th

Re: [rspec-users] Cucumber custome reports

2009-04-28 Thread aslak hellesoy
> > My actual question is, Is there any api that the cucumber offer which > can be accessed to get the necessary data in the run time. > http://wiki.github.com/aslakhellesoy/cucumber/hooks > > -- > Posted via http://www.ruby-forum.com/. > ___ > rspec-u

Re: [rspec-users] [cucumber] Use of Scenario Outline for validation stuff ?

2009-04-28 Thread Jérémy Kaz
Ahm Please someone delete this post, I didn't see my post is already present on the topic list, coming from the rubyforge rspec mailing list I guess. My apologies anyway ... -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing li

[rspec-users] [cucumber] Use of Scenario Outline for validation stuff ?

2009-04-28 Thread Jérémy Kaz
Hi there ! I was wondering if the way I test the validation of my forms is right or not. So here's a little example : Imagine you have a form with some validations designed to create some object. You want to test it using Scenario Outline and Examples. So you fill in the fields using , and press th

Re: [rspec-users] [cucumber] Use of Scenario Outline for validation stuff ?

2009-04-28 Thread Jérémy Kaz
Sorry about bad formating, I pasted it and haven't checked ... Well, you may have understood that the "<" thing is pointing to the 'And the VAT "" ...' line, the 1st col of 2nd line in the examples is a blank one, and the last line is cut into 2 -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] Cucumber custome reports

2009-04-28 Thread Sarath Menon
My actual question is, Is there any api that the cucumber offer which can be accessed to get the necessary data in the run time. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mail

Re: [rspec-users] Cucumber custome reports

2009-04-28 Thread aslak hellesoy
> Hi, > > I need to create a custom report based on cucumber output. I am thinking > of two ways to do this. > > > 1. Either I have to write a java application to fetch the values like > execution time for each scenarios along with its name, status etc from > cucumber in runtime. Is that possible?

[rspec-users] Cucumber custome reports

2009-04-28 Thread Sarath Menon
Hi, I need to create a custom report based on cucumber output. I am thinking of two ways to do this. 1. Either I have to write a java application to fetch the values like execution time for each scenarios along with its name, status etc from cucumber in runtime. Is that possible? 2. Or write a