Re: [rspec-users] Shoulda

2008-09-30 Thread Andy Freeman
Are you willing to provide a simple example? Andy Matt Wynne wrote: We do something similar to this, though we use a convention to set @klass to the class being spec'd in the top-level example group, rather than deriving it as they do in that sample. In view specs we also use a convention

Re: [rspec-users] Shoulda

2008-09-30 Thread Zach Dennis
On Tue, Sep 30, 2008 at 8:41 AM, Andy Freeman [EMAIL PROTECTED] wrote: Are you willing to provide a simple example? I'm using the same example as the articled you linked to originally as the base. This way you should be able to clearly see the differences. http://gist.github.com/13804 Zach

Re: [rspec-users] Shoulda

2008-09-30 Thread Zach Dennis
Also, a nice thing about RSpec is that when you do describe an actual object, ie: describe Foo, you can determine this by asking the example group what it's described type is. This makes things a lot simpler and cleaner than having to hack away strings, or guess based on the name of your test.

Re: [rspec-users] Fwd: ZenTest Autotest and 1.1.5

2008-09-30 Thread David Chelimsky
On Tue, Sep 30, 2008 at 8:02 AM, Ashley Moran [EMAIL PROTECTED] wrote: Begin forwarded message: Use either the installed autospec (not autotest) or script/autospec commands (for rails apps). http://rspec.info/rdoc/files/History_txt.html Cheers, David Hmmm, when I run autospec, all I

Re: [rspec-users] Best way to determine if RSpec is loaded?

2008-09-30 Thread Ashley Moran
On 29 Sep 2008, at 13:28, David Chelimsky wrote: In theory it should be fine, but when you're running a suite of examples you're going to eventually want to load up everything in the app, no? True! But I've had a lot of loading issues lately, when autotest runs a single file and

Re: [rspec-users] Fwd: ZenTest Autotest and 1.1.5

2008-09-30 Thread Ashley Moran
On 30 Sep 2008, at 14:06, David Chelimsky wrote: I just noticed that too on a new project. It's the spec_helper that's causing the trouble, so it needs to be ignored. Put this in a .autotest file at the root of your project: Autotest.add_hook :initialize do |at| at.add_exception

[rspec-users] Cucumber::ArityMismatchError

2008-09-30 Thread aidy lewis
Hi, We are receiving an ArityMismatchError when we feel we have a valid RegEx error C:/svnprojects/olc_stories/lib/framework/common_steps/verification_steps.rb:48:in `/verify the email with the subject of '[\w\x2E\-\s]*'/' create_staff_user.feature:15:in `And verify the email with the

Re: [rspec-users] Cucumber::ArityMismatchError

2008-09-30 Thread aslak hellesoy
On Tue, Sep 30, 2008 at 3:59 PM, aidy lewis [EMAIL PROTECTED] wrote: Hi, We are receiving an ArityMismatchError when we feel we have a valid RegEx error C:/svnprojects/olc_stories/lib/framework/common_steps/verification_steps.rb:48:in `/verify the email with the subject of '[\w\x2E\-\s]*'/'

Re: [rspec-users] Fwd: ZenTest Autotest and 1.1.5

2008-09-30 Thread David Chelimsky
On Tue, Sep 30, 2008 at 8:15 AM, Ashley Moran [EMAIL PROTECTED] wrote: On 30 Sep 2008, at 14:06, David Chelimsky wrote: I just noticed that too on a new project. It's the spec_helper that's causing the trouble, so it needs to be ignored. Put this in a .autotest file at the root of your

Re: [rspec-users] Cucumber::ArityMismatchError

2008-09-30 Thread David Chelimsky
On Tue, Sep 30, 2008 at 8:59 AM, aidy lewis [EMAIL PROTECTED] wrote: Hi, We are receiving an ArityMismatchError when we feel we have a valid RegEx error C:/svnprojects/olc_stories/lib/framework/common_steps/verification_steps.rb:48:in `/verify the email with the subject of '[\w\x2E\-\s]*'/'

Re: [rspec-users] Cucumber::ArityMismatchError

2008-09-30 Thread aidy lewis
Aslak 2008/9/30 aslak hellesoy [EMAIL PROTECTED]: There are no groups in your regexp. You probably want this: /verify the email with the subject of '([\w\x2E\-\s]*)'/ Aslak Apologies. Thank You. Aidy ___ rspec-users mailing list

[rspec-users] Using the response object in stories

2008-09-30 Thread Juanma Cervera
I have this statement in the layout of my application (using haml) - if request.env[HTTP_USER_AGENT].include?(MSIE) = stylesheet_link_tag 'blueprint/ie.css' = stylesheet_link_tag 'confirm_ie.css' The problem is that request.env[HTTP_USER_AGENT] is nil when I go to some page in the features I

Re: [rspec-users] Shoulda

2008-09-30 Thread Ben Mabey
David Chelimsky wrote: On Tue, Sep 30, 2008 at 7:59 AM, Zach Dennis [EMAIL PROTECTED] wrote: Also, a nice thing about RSpec is that when you do describe an actual object, ie: describe Foo, you can determine this by asking the example group what it's described type is. This makes things a

[rspec-users] How do BOTH these examples pass?

2008-09-30 Thread Ashley Moran
Hi I'm, being thick, right?: describe RssReader do before(:each) do @uri = mock(URI) ::RSS::Parser.stub!(:parse).and_return(:parsed_rss) @rss_reader = RssReader.new(@uri) end describe when the RSS content loads do # ... end describe when there is an HTTP

Re: [rspec-users] Cucumber - stub! or mock?

2008-09-30 Thread Luke Melia
On Sep 15, 2008, at 4:35 PM, Pat Maddox wrote: I don't think you're really supposed to mock or stub when using cucumber. We need to stub time in some of our scenarios, which exist to to verify behavior over time. We're looking into a before/after to support mocking/stubbing for this

Re: [rspec-users] How do BOTH these examples pass?

2008-09-30 Thread Ashley Moran
On 30 Sep 2008, at 15:51, Ashley Moran wrote: it should not attempt to parse the RSS do Or, it should attempt to parse the RSS do Please excuse the typo... Ashley -- http://www.patchspace.co.uk/ http://aviewfromafar.net/ ___ rspec-users

Re: [rspec-users] Cucumber - stub! or mock?

2008-09-30 Thread David Chelimsky
On Tue, Sep 30, 2008 at 9:55 AM, Luke Melia [EMAIL PROTECTED] wrote: On Sep 15, 2008, at 4:35 PM, Pat Maddox wrote: I don't think you're really supposed to mock or stub when using cucumber. We need to stub time in some of our scenarios, which exist to to verify behavior over time. We're

Re: [rspec-users] RSpec makes me want to write better code

2008-09-30 Thread Matt Wynne
I like them much better than the gremlins. On 30 Sep 2008, at 14:09, Dan North wrote: We do have pixies! They do all the magic stuff. How else do you think it happens? ;) 2008/9/27 aslak hellesoy [EMAIL PROTECTED] On Sat, Sep 27, 2008 at 10:32 PM, David Chelimsky [EMAIL PROTECTED] wrote:

Re: [rspec-users] Cucumber - stub! or mock?

2008-09-30 Thread David Chelimsky
On Tue, Sep 30, 2008 at 10:26 AM, Scott Taylor [EMAIL PROTECTED] wrote: On Sep 30, 2008, at 11:06 AM, David Chelimsky wrote: On Tue, Sep 30, 2008 at 9:55 AM, Luke Melia [EMAIL PROTECTED] wrote: On Sep 15, 2008, at 4:35 PM, Pat Maddox wrote: I don't think you're really supposed to mock or

Re: [rspec-users] Using the response object in stories

2008-09-30 Thread Matt Wynne
I'm sure it's possible, but sorry I don't know how offhand. I'll tell you what I know and see if it's enough to help you figure it out for yourself. The code you write in cucumber steps (which calls webrat) runs inside the context of a rails ActionController::Integration::Session. Have a

Re: [rspec-users] Cucumber - stub! or mock?

2008-09-30 Thread Pat Maddox
Scott Taylor [EMAIL PROTECTED] writes: On Sep 30, 2008, at 11:06 AM, David Chelimsky wrote: On Tue, Sep 30, 2008 at 9:55 AM, Luke Melia [EMAIL PROTECTED] wrote: On Sep 15, 2008, at 4:35 PM, Pat Maddox wrote: I don't think you're really supposed to mock or stub when using cucumber. We

Re: [rspec-users] Cucumber - stub! or mock?

2008-09-30 Thread Scott Taylor
On Sep 30, 2008, at 12:04 PM, Pat Maddox wrote: Scott Taylor [EMAIL PROTECTED] writes: On Sep 30, 2008, at 11:06 AM, David Chelimsky wrote: On Tue, Sep 30, 2008 at 9:55 AM, Luke Melia [EMAIL PROTECTED] wrote: On Sep 15, 2008, at 4:35 PM, Pat Maddox wrote: I don't think you're really

Re: [rspec-users] Shoulda

2008-09-30 Thread Zach Dennis
On Tue, Sep 30, 2008 at 10:38 AM, Ben Mabey [EMAIL PROTECTED] wrote: David Chelimsky wrote: On Tue, Sep 30, 2008 at 7:59 AM, Zach Dennis [EMAIL PROTECTED] wrote: Also, a nice thing about RSpec is that when you do describe an actual object, ie: describe Foo, you can determine this by asking

Re: [rspec-users] Using the response object in stories

2008-09-30 Thread Juanma Cervera
Thanks Matt. I have check the rails api and see that I can pass a hash with the headers as a parameter with the post command. post /session, {:username = 'matt', :password = 'secret'}, {:HTTP_USER_AGENT = MSIE} and this works for me, by now, I don't know if I will have some

Re: [rspec-users] Using the response object in stories

2008-09-30 Thread Matt Wynne
Cool. Be aware that you're by-passing webrat by using the post method - that's one of the 'raw' rails calls that webrat wraps up in its elegant set of methods. It may be that you can pass this same hash to clicks_button but I don't know - you'd have to check the webrat source. On 30

[rspec-users] Spec for 'an array should not include an item'

2008-09-30 Thread Neil Cauldwell
Does anyone know how I can write a spec along the lines of this (but a working implementation); it should not include inactive users do do_get assigns[:results].should_not include(users(:inactive_user)) end I'm a newbie so I'm not capable of explaining why it doesn't work, but

Re: [rspec-users] Spec for 'an array should not include an item'

2008-09-30 Thread Pat Maddox
Neil Cauldwell [EMAIL PROTECTED] writes: Does anyone know how I can write a spec along the lines of this (but a working implementation); it should not include inactive users do do_get assigns[:results].should_not include(users(:inactive_user)) end I'm a newbie so I'm not

Re: [rspec-users] Spec for 'an array should not include an item'

2008-09-30 Thread Ben Mabey
Pat Maddox wrote: Neil Cauldwell [EMAIL PROTECTED] writes: Does anyone know how I can write a spec along the lines of this (but a working implementation); it should not include inactive users do do_get assigns[:results].should_not include(users(:inactive_user)) end I'm a

[rspec-users] Cucumber: please make gem install aslakhellesoy-cucumber or gem install cucumber work again

2008-09-30 Thread Evan David Light
Subject says most of it. I'd love to use Cucumber in my project but I need to be able to install it in a Rails app and by a particular version number. I forked it and struggled with getting GitHub gems deployer to behave itself. Maybe a canonical version can be kept and updated in

Re: [rspec-users] Cucumber - stub! or mock?

2008-09-30 Thread Luke Melia
On Sep 30, 2008, at 10:55 AM, Luke Melia wrote: We need to stub time in some of our scenarios, which exist to to verify behavior over time. We're looking into a before/after to support mocking/stubbing for this scenario. Thanks for everyone's thoughts. I understand that mocks are

Re: [rspec-users] Cucumber: please make gem install aslakhellesoy-cucumber or gem install cucumber work again

2008-09-30 Thread aslak hellesoy
On Tue, Sep 30, 2008 at 9:02 PM, Evan David Light [EMAIL PROTECTED] wrote: Subject says most of it. I'd love to use Cucumber in my project but I need to be able to install it in a Rails app and by a particular version number. You can do that with git pull and git checkout. Would it help if

Re: [rspec-users] Cucumber: please make gem install aslakhellesoy-cucumber or gem install cucumber work again

2008-09-30 Thread Evan Light
On Sep 30, 2008, at 5:20 PM, aslak hellesoy wrote: On Tue, Sep 30, 2008 at 9:02 PM, Evan David Light [EMAIL PROTECTED] wrote: Subject says most of it. I'd love to use Cucumber in my project but I need to be able to install it in a Rails app and by a particular version number. You can

Re: [rspec-users] Shoulda

2008-09-30 Thread Andy Freeman
What's not to like?! Despite the fact that a new RSpec version was just released, it would be nice to see a new version released right away with this concept built in so that a RSpec version of Shoulda could start rolling. :) David Chelimsky wrote: On Tue, Sep 30, 2008 at 7:59 AM, Zach

Re: [rspec-users] Why no rspec-rails gem?

2008-09-30 Thread Tim Harper
I released 1.1.5 yesterday, including rspec-1.1.5 and rspec- rails-1.1.5 gems. It works fantastic. Thanks for a quality release. I've freed up about 100 of megs on my hard drive already. Cheers, David ___ rspec-users mailing list

Re: [rspec-users] Shoulda

2008-09-30 Thread David Chelimsky
On Tue, Sep 30, 2008 at 10:18 PM, Andy Freeman [EMAIL PROTECTED] wrote: David Chelimsky wrote: On Tue, Sep 30, 2008 at 7:59 AM, Zach Dennis [EMAIL PROTECTED] wrote: On Tue, Sep 30, 2008 at 8:41 AM, Andy Freeman [EMAIL PROTECTED] wrote: Are you willing to provide a simple example? I'm using

Re: [rspec-users] Shoulda

2008-09-30 Thread David Chelimsky
On Tue, Sep 30, 2008 at 9:38 AM, Ben Mabey [EMAIL PROTECTED] wrote: David Chelimsky wrote: On Tue, Sep 30, 2008 at 7:59 AM, Zach Dennis [EMAIL PROTECTED] wrote: Also, a nice thing about RSpec is that when you do describe an actual object, ie: describe Foo, you can determine this by asking

Re: [rspec-users] Shoulda

2008-09-30 Thread Andy Freeman
I was actually teasing... :) As far as writing one... already on it! David Chelimsky wrote: On Tue, Sep 30, 2008 at 10:18 PM, Andy Freeman [EMAIL PROTECTED] wrote: Here's a variation on that with a helper for defining macros that I'm thinking of adding to rspec. Lemme know what you think: