Re: [rspec-users] stubbing Time.zone.now for model tests fails for Rails 2.3.1

2009-03-14 Thread Bart Zonneveld
On 12 mrt 2009, at 04:22, Stephen Eley wrote: On Wed, Mar 11, 2009 at 1:40 PM, David Schmidt wrote: Has anyone else run into this problem and come up with a solution to getting a fixed time back from Time.zone.now? This plugin has worked very well for me: http://github.com/notahat/time

Re: [rspec-users] [cucumber] Performance of 0.1.99?

2009-03-14 Thread aslak hellesoy
On Sat, Mar 14, 2009 at 7:00 AM, Luke Melia wrote: > Has anyone noticed a slowdown in performance of their cucumber suite from > 0.1 to 0.2alpha? > > I haven't ruled out something in our suite itself, but the slowdown > appeared to occur concurrently with our upgrade to 0.2alpha. > I haven't not

Re: [rspec-users] stubbing Time.zone.now for model tests fails for Rails 2.3.1

2009-03-14 Thread Bart Zonneveld
On 14 mrt 2009, at 11:27, Bart Zonneveld wrote: On 12 mrt 2009, at 04:22, Stephen Eley wrote: On Wed, Mar 11, 2009 at 1:40 PM, David Schmidt mt.com> wrote: Has anyone else run into this problem and come up with a solution to getting a fixed time back from Time.zone.now? This plugin has

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Matt Wynne
On 13 Mar 2009, at 21:47, aslak hellesoy wrote: On Fri, Mar 13, 2009 at 10:28 PM, Tim Hart wrote: List, Quick question about Cucumber/Gherkin. I'm considering adding 'With' as a step definition to support scenarios like: Given a policy With a PCF practice state And a secondary risk

[rspec-users] how to test this view with Rspec

2009-03-14 Thread Zhenning Guan
= flash_messages - @user = User.find(1) - if current_user == @user %new_forum= link_to 'new forum', new_forum_path - @forum.each do |f| .group = link_to f.name, forum_path(f) - if current_user == @user = link_to 'edit', edit_forum_path(f) = link_to 'destroy', forum_path(f),

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Aslak Hellesøy
Den 14. mars. 2009 kl. 13.59 skrev Matt Wynne : On 13 Mar 2009, at 21:47, aslak hellesoy wrote: On Fri, Mar 13, 2009 at 10:28 PM, Tim Hart wrote: List, Quick question about Cucumber/Gherkin. I'm considering adding 'With' as a step definition to support scenarios like: Given a po

Re: [rspec-users] how to test this view with Rspec

2009-03-14 Thread Thomas R. Koll
Am 14.03.2009 um 14:12 schrieb Zhenning Guan: = flash_messages - @user = User.find(1) move that to the controller or a helper. always. and if you try to find the admin with that, add a flag on the user so you can write current_user.admin? > - @forum.each do |f| > .group > = link_to f.

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Tim Hart
On Mar 14, 2009, at 8:49 AM, "Aslak Hellesøy" wrote: > > > Den 14. mars. 2009 kl. 13.59 skrev Matt Wynne : > >> >> On 13 Mar 2009, at 21:47, aslak hellesoy wrote: >> >>> >>> >>> On Fri, Mar 13, 2009 at 10:28 PM, Tim Hart >>> wrote: >>> List, >>> >>> Quick question about Cucumber/Gherkin. >>> >

Re: [rspec-users] Spec'ing chained calls

2009-03-14 Thread Levy Carneiro Jr.
Hello Scott, On Fri, Mar 13, 2009 at 11:59 AM, Scott Taylor wrote: > http://c2.com/cgi/wiki?LawOfDemeter > > Specs are as much of a design tool as a testing tool, and the use of mocks > in your specs show just how ugly the current design is. > > Either write a wrapper around the library which tak

Re: [rspec-users] [cucumber] open source projects with cucumber features

2009-03-14 Thread Matt Wynne
On 13 Mar 2009, at 18:13, Oliver Barnes wrote: Rails, but any other would be helpful as well, really. Just a repo of varied real-world cucumber feature examples already would help a lot, even without the feature steps or an actual developed app. I've been mining samples from pasties, tutorials

Re: [rspec-users] [cucumber] Performance of 0.1.99?

2009-03-14 Thread Matt Wynne
On 14 Mar 2009, at 10:06, aslak hellesoy wrote: On Sat, Mar 14, 2009 at 7:00 AM, Luke Melia wrote: Has anyone noticed a slowdown in performance of their cucumber suite from 0.1 to 0.2alpha? Ours is getting slower all the time (as we add more features) so it's very hard to say. I've noti

[rspec-users] Perl 5 Cucumber

2009-03-14 Thread Evgeny
Hi all, I have started a mini-cucumber clone written in Perl. So for those of you working for enterprises that ruby has no foothold but perl has fortresses, this might be a nice way to get it through ... it is in my case anyway. Other than that I would like to extend a plee for help, and if anyon

Re: [rspec-users] [cucumber] Performance of 0.1.99?

2009-03-14 Thread Joseph Wilk
Matt Wynne wrote: On 14 Mar 2009, at 10:06, aslak hellesoy wrote: On Sat, Mar 14, 2009 at 7:00 AM, Luke Melia wrote: Has anyone noticed a slowdown in performance of their cucumber suite from 0.1 to 0.2alpha? Ours is getting slower all the time (as we add more features) so it's very hard t

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Mark Wilden
On Sat, Mar 14, 2009 at 5:59 AM, Matt Wynne wrote: > I'm not sure if I like this - dependency between steps seems like a dodgy > road to go down. I'm wondering how you'd feel about a style I've adopted: Scenario: Accepting a direct challenge, without leaving a comment Given there is a cha

[rspec-users] [Cucumber] When do you log in? (was- Adding a step definition)

2009-03-14 Thread David Chelimsky
On Sat, Mar 14, 2009 at 10:50 AM, Mark Wilden wrote: > On Sat, Mar 14, 2009 at 5:59 AM, Matt Wynne wrote: > >> I'm not sure if I like this - dependency between steps seems like a dodgy >> road to go down. > > I'm wondering how you'd feel about a style I've adopted: > > Scenario: Accepting a dire

Re: [rspec-users] [cucumber] Performance of 0.1.99?

2009-03-14 Thread Luke Melia
On Mar 14, 2009, at 6:06 AM, aslak hellesoy wrote: On Sat, Mar 14, 2009 at 7:00 AM, Luke Melia wrote: Has anyone noticed a slowdown in performance of their cucumber suite from 0.1 to 0.2alpha? I haven't noticed anything. Do you want to create a benchmark? I just ran a subset of our sui

Re: [rspec-users] [Cucumber] When do you log in? (was- Adding a step definition)

2009-03-14 Thread Joseph Wilk
David Chelimsky wrote: On Sat, Mar 14, 2009 at 10:50 AM, Mark Wilden wrote: On Sat, Mar 14, 2009 at 5:59 AM, Matt Wynne wrote: I'm not sure if I like this - dependency between steps seems like a dodgy road to go down. I'm wondering how you'd feel about a style I've adopted:

Re: [rspec-users] [Cucumber] When do you log in? (was- Adding a step definition)

2009-03-14 Thread David Chelimsky
On Sat, Mar 14, 2009 at 1:04 PM, Joseph Wilk wrote: > David Chelimsky wrote: >> >> On Sat, Mar 14, 2009 at 10:50 AM, Mark Wilden wrote: >> >>> >>> On Sat, Mar 14, 2009 at 5:59 AM, Matt Wynne wrote: >>> >>> I'm not sure if I like this - dependency between steps seems like a dodgy >

Re: [rspec-users] [cucumber] accessing session variables

2009-03-14 Thread Balint Erdi
Hey Matt, Thanks a lot for your elaborated response! After reading this excellent thread about how to pass state between steps: http://www.mail-archive.com/rspec-users@rubyforge.org/msg06296.html I realized 1. I am not alone in this boat :) 2. that if I write "I go to", "my profile page" ther

Re: [rspec-users] [cucumber] open source projects with cucumber features

2009-03-14 Thread Balint Erdi
Yes, I am writing a Rails app. Anyway, I have got over the initial "writer's block" thanks to a very insightful thread on this forum (http://www.mail-archive.com/rspec-users@rubyforge.org/msg06296.html) and your valuable help. Thank you all! Balint Matt Wynne wrote: > On 11 Mar 2009, at 19:46,

Re: [rspec-users] [webrat] click link by title doesn't work

2009-03-14 Thread Balint Erdi
Andrew Premdas wrote: > > When /^I follow view (\w+) details link$/ do |object| > click_link "#{object}_details}" > end I think the problem is that you have an extra } in the title of the link you are looking for. It should just be: When /^I follow view (\w+) details link$/ do |object| cli

Re: [rspec-users] [webrat] click link by title doesn't work

2009-03-14 Thread Andrew Premdas
Doh!, thanks alot :). 2009/3/14 Balint Erdi > Andrew Premdas wrote: > > > > > When /^I follow view (\w+) details link$/ do |object| > > click_link "#{object}_details}" > > end > > I think the problem is that you have an extra } in the title of the link > you are looking for. It should just be:

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Andrew Premdas
Is the syntax you're using a misreading of the wiki advice on Feature-Coupled Steps. Why not have "GIven a policy with a PCF practice state and seconday risk" This is not a featured coupled step because PCF practice state and secondary risk are part of the Policies state and are not seperate. Se

Re: [rspec-users] [cucumber] accessing session variables

2009-03-14 Thread Matt Wynne
On 14 Mar 2009, at 19:11, Balint Erdi wrote: Hey Matt, Thanks a lot for your elaborated response! After reading this excellent thread about how to pass state between steps: http://www.mail-archive.com/rspec-users@rubyforge.org/msg06296.html I realized 1. I am not alone in this boat :) 2. t

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Matt Wynne
On 14 Mar 2009, at 15:50, Mark Wilden wrote: On Sat, Mar 14, 2009 at 5:59 AM, Matt Wynne wrote: I'm not sure if I like this - dependency between steps seems like a dodgy road to go down. I'm wondering how you'd feel about a style I've adopted: Scenario: Accepting a direct challenge,

[rspec-users] Ruby - LiquidTest- Documentation

2009-03-14 Thread Ashley Moran
Hi all Just wondering if anyone here has seen and/or used LiquidTest[1]? I notice they have Cucumber integration too. Has/would anyone pay for this? (It's out of the question for me, as there's no Mac support.) Cheers Ashley [1] http://www.jadeliquid.com/liquidtest/docs/doku.php?id=lan

Re: [rspec-users] [Cucumber] When do you log in? (was- Adding a step definition)

2009-03-14 Thread wolfmanjm
I use something similar, however as I need to have my database pre populated with valid user accounts (the dreaded fixtures) I use something like.. Given the following users are logged in: |user| |first| |second| |third| When the first user sends a message to the second us

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Tim Hart
On Mar 14, 2009, at 3:38 PM, "Andrew Premdas" mailto:aprem...@gmail.com>> wrote: Is the syntax you're using a misreading of the wiki advice on Feature-Coupled Steps. Why not have "GIven a policy with a PCF practice state and seconday risk" Because the work we are currently doing is going to i

Re: [rspec-users] Ruby - LiquidTest- Documentation

2009-03-14 Thread Matt Wynne
On 14 Mar 2009, at 21:26, Ashley Moran wrote: Hi all Just wondering if anyone here has seen and/or used LiquidTest[1]? I notice they have Cucumber integration too. Has/would anyone pay for this? (It's out of the question for me, as there's no Mac support.) Cheers Ashley [1] http://w

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Mark Wilden
On Sat, Mar 14, 2009 at 1:33 PM, Matt Wynne wrote: > We also have a nifty little convention that allows us to talk about 'the > Widget "Foo"' and 'the Widget "Bar"' because pretty much every entity in our > domain (or at least the ones we refer to like this in our features) has a > #name attribut

Re: [rspec-users] Ruby - LiquidTest- Documentation

2009-03-14 Thread Ashley Moran
On 14 Mar 2009, at 21:51, Matt Wynne wrote: Presumably what you're paying for is all the record / playback rubbish that allows the unqualified to produce brittle test suites. Wouldn't touch it with a barge pole myself. Well that was my initial reaction! Although it does have distributed,

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Matt Wynne
On 14 Mar 2009, at 22:01, Tim Hart wrote: On Mar 14, 2009, at 3:38 PM, "Andrew Premdas" mailto:aprem...@gmail.com >> wrote: Is the syntax you're using a misreading of the wiki advice on Feature-Coupled Steps. Why not have "GIven a policy with a PCF practice state and seconday risk" Beca

Re: [rspec-users] [cucumber] accessing session variables

2009-03-14 Thread Balint Erdi
Oh, I see. I'll heed your advice and will consider using @user for the logged in user in the future. Thanks again, Balint Matt Wynne wrote: > On 14 Mar 2009, at 19:11, Balint Erdi wrote: > >> >> nice >> >> 3. using instance variables to pass state in the course of a features >> makes step defin

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Josh Chisholm
> That sounds like a great way to avoid the instance variable. Why is a named record preferable to an instance variable? It seems like the coupling between steps is the same, but the coupled state is stored differently. Maybe that's the point - stored differently. I've been tempted to start scena

Re: [rspec-users] rspec 1.1.99.12, Rails 2.3.1, undefined method `rspec_options='

2009-03-14 Thread José Gomes Jr .
Thank you for providing the requested information. On 12 mar, 13:44, David Chelimsky wrote: > On Sun, Mar 8, 2009 at 6:19 PM,JoséGomes Jr. wrote: > > > > > Hi David, all: > > > I recently upgraded to Rails 2.3.1RC2 (Ubuntu 8.10, ruby 1.8.7 > > (2008-08-11 patchlevel 72) [i486-linux]) and have

Re: [rspec-users] Cucumber - Adding a step definition

2009-03-14 Thread Matt Wynne
On 15 Mar 2009, at 00:30, Josh Chisholm wrote: That sounds like a great way to avoid the instance variable. Why is a named record preferable to an instance variable? It seems like the coupling between steps is the same, but the coupled state is stored differently. Maybe that's the point - sto

Re: [rspec-users] rspec, rspec-rails 1.1.99-12 and script/spec 'no such file to load -- spec'

2009-03-14 Thread geetarista
I'm having similar issues, but when I run the CMD + R command in Textmate: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- spec (LoadError) from /System/Library/Frameworks/ Ruby.framework/Vers

[rspec-users] [cucumber] A Perl 5 mini-cucumber

2009-03-14 Thread Evgeny
Hi All, I wrote a Cucumber version in Perl 5. It's very minimal, but maybe someone will find it interesting. Check it out on http://github.com/kesor/p5-cucumber - evgeny ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailm

[rspec-users] How to use different mocking frameworks?

2009-03-14 Thread Val
Hi, I'm pretty new to Rspec, so hope someone can help me out with this. I'm leveraging a couple pre-existing applications in my current project, both have fairly robust test suites in Rspec already. However, one is using Rspec's builit in mocking, and the other is using mocha. If I set config.mo

Re: [rspec-users] How to use different mocking frameworks?

2009-03-14 Thread David Chelimsky
On Sat, Mar 14, 2009 at 8:37 PM, Val wrote: > Hi, > > I'm pretty new to Rspec, so hope someone can help me out with this. > > I'm leveraging a couple pre-existing applications in my current > project, both have fairly robust test suites in Rspec already. > However, one is using Rspec's builit in m

[rspec-users] Rspec and EventMachine

2009-03-14 Thread Julien
Hey Guys, I am trying to create a app that makes use of EventMachine. As I recently fell in love with Rspec, I was trying to use it with our EM. However, I have no idea how to do this. Also, I want to remove network connections from the tests (as I might not be connected when running them), so I t

[rspec-users] Cucumber - adding a step definition

2009-03-14 Thread Tim Hart
List, Quick question about Cucumber/Gherkin. I'm considering adding 'With' as a step definition to support scenarios like: Given a policy With a PCF practice state And a secondary risk ... I'm fairly new to ruby - but I can't quite get this one figured out. I've tried adding Cucumber.alias_st

Re: [rspec-users] How to use different mocking frameworks?

2009-03-14 Thread David Chelimsky
On Sun, Mar 15, 2009 at 12:01 AM, David Chelimsky wrote: > On Sat, Mar 14, 2009 at 8:37 PM, Val wrote: >> Hi, >> >> I'm pretty new to Rspec, so hope someone can help me out with this. >> >> I'm leveraging a couple pre-existing applications in my current >> project, both have fairly robust test su