Re: [rspec-users] specifying which button webrat should press

2008-11-19 Thread David Chelimsky
On Thu, Nov 20, 2008 at 12:07 AM, Pau Cor <[EMAIL PROTECTED]> wrote: > aslak hellesoy wrote: >> give buttons unique dom ids and pass the id to #clicks_button ? > > Of course that's the easy way to do it :) > > I was hoping to keep my stories a bit closer to English. Plus then I'd > need some extra

Re: [rspec-users] specifying which button webrat should press

2008-11-19 Thread Pau Cor
aslak hellesoy wrote: > give buttons unique dom ids and pass the id to #clicks_button ? Of course that's the easy way to do it :) I was hoping to keep my stories a bit closer to English. Plus then I'd need some extra instance variable so that step can calculate the dom_id. Here is an example o

Re: [rspec-users] specifying which button webrat should press

2008-11-19 Thread aslak hellesoy
On Thu, Nov 20, 2008 at 4:32 AM, Pau Cor <[EMAIL PROTECTED]> wrote: > I was writing a feature in which I had webrat push a button. However, > there are many buttons on this page with the same text. I wanted to > specify which one would be push in as close a way I could to the way a > person would d

[rspec-users] specifying which button webrat should press

2008-11-19 Thread Pau Cor
I was writing a feature in which I had webrat push a button. However, there are many buttons on this page with the same text. I wanted to specify which one would be push in as close a way I could to the way a person would describe which one he was pushing. Here is what I ended up with: #custom_web

Re: [rspec-users] Examples using cucumber, celerity, rspec

2008-11-19 Thread Ashley Moran
On Nov 17, 2008, at 1:00 am, Alvin Schur wrote: I created some simple examples using cucumber, celerity, and rspec to verify the behaviour of a web application. The examples include: * verifying javascript ran on page load * verifying results of AJAX calls * responding to alerts and c

Re: [rspec-users] RSpec, TestUnit, Cucumber and Autotest

2008-11-19 Thread James Byrne
Ben Mabey wrote: > James Byrne wrote: >> >> > Try doing TRUE in all lowercase. > > -Ben $ set AUTOFEATURE=true BASH=/bin/bash ... -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/m

Re: [rspec-users] RSpec, TestUnit, Cucumber and Autotest

2008-11-19 Thread Ben Mabey
James Byrne wrote: OS=CentOS-5.2 Ruby=1.8.6 Rails=2.2.1_RC Gems all up to date I have been experimenting with autotest and I have a few questions. 1. given export AUTOFEATURES=TRUE if ./test exists (with tests) then these tests are run and the features are not. Is this intended behaviour?

[rspec-users] RSpec, TestUnit, Cucumber and Autotest

2008-11-19 Thread James Byrne
OS=CentOS-5.2 Ruby=1.8.6 Rails=2.2.1_RC Gems all up to date I have been experimenting with autotest and I have a few questions. 1. given export AUTOFEATURES=TRUE if ./test exists (with tests) then these tests are run and the features are not. Is this intended behaviour? 2. given require 'autote

[rspec-users] Invitation to join RSpec Users

2008-11-19 Thread Ashley Moran
Hi There wasn't a lot of interest but I set up an RSpec Users group on LinkedIn[1] anyway. I did try to pre-approve everyone who has posted to this list since March, but LinkedIn's CSV uploader appears to be borked, so I'll have to approve you manually. Oh and I made a cool logo for RSpe

Re: [rspec-users] Testing on enter state

2008-11-19 Thread Mark Wilden
In other words, the object changes its private state to achieve a publically visible result (otherwise, why bother?) Test that result. ///ark ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] `add_scenario': wrong, number of arguments (1 for 2)

2008-11-19 Thread aslak hellesoy
On Wed, Nov 19, 2008 at 5:23 PM, Bret Pettichord <[EMAIL PROTECTED]> wrote: > aslak hellesoy wrote: >> >> On Wed, Nov 19, 2008 at 2:46 AM, Bret Pettichord <[EMAIL PROTECTED]> >> wrote: >> >>> >>> Ben Mabey wrote: >>> Are you using the latest cucumber from github? >>> >>> Yes. I did a

Re: [rspec-users] Mocking and stubbing model relationships

2008-11-19 Thread Chris Flipse
I've actually taken this old gem and enhanced it a bit module Spec::Mocks::Methods def stub_association!(association_name, methods_to_be_stubbed ={}) mock_assn = Spec::Mocks::Mock.new(association_name.to_s) stub_association_with(association_name, mock_assn, methods_to_be_stubbed) end

Re: [rspec-users] `add_scenario': wrong, number of arguments (1 for 2)

2008-11-19 Thread Bret Pettichord
aslak hellesoy wrote: On Wed, Nov 19, 2008 at 2:46 AM, Bret Pettichord <[EMAIL PROTECTED]> wrote: Ben Mabey wrote: Are you using the latest cucumber from github? Yes. I did a git pull and reproduced the error right before reporting it. This was fixed three days ago (!?) ht

Re: [rspec-users] `add_scenario': wrong, number of arguments (1 for 2)

2008-11-19 Thread Bret Pettichord
aslak hellesoy wrote: On Wed, Nov 19, 2008 at 3:03 AM, Bret Pettichord <[EMAIL PROTECTED]> wrote: Ben Mabey wrote: If that is not the issue please open a ticket on Lighthouse. I tried. lighthouse error elaborate? I got a generic lighthouse error. I pasted a screenshot

Re: [rspec-users] Cucumber - how to spec a quick search box

2008-11-19 Thread Mikel Lindsaar
On Wed, Nov 19, 2008 at 1:32 PM, Bryan Helmkamp <[EMAIL PROTECTED]> wrote: > If the form tag has an ID, you can use Webrat' new submit_form method > to do just this sort of thing. > Not wrong about being new :) 24 hours ago... recent enough not to be in the History.txt file and I had to go hunti

Re: [rspec-users] Testing on enter state

2008-11-19 Thread Mark Wilden
In other words, the object changes its private state to achieve a publically visible result (otherwise, why bother?) Test that result. ///ark ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Testing on enter state

2008-11-19 Thread Rahoul Baruah
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 19 Nov 2008, at 14:01, David Chelimsky wrote: For example, this: describe Dog do it "should increase its heart rate when the postman arrives" do dog = Dog.new lambda {dog.see Postman.new}.should change{dog.heartrate}.by(10) end end rat

Re: [rspec-users] Testing on enter state

2008-11-19 Thread Ramon Tayag
Ahh.. yes, you do. Thanks a lot! That definitely answers my question. Ramon Tayag On Wed, Nov 19, 2008 at 10:01 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: > I didn't mean make the methods public. I meant use the public API. > > For example, this: > > describe Dog do > it "should increase i

Re: [rspec-users] Testing on enter state

2008-11-19 Thread David Chelimsky
On Wed, Nov 19, 2008 at 7:55 AM, Ramon Tayag <[EMAIL PROTECTED]> wrote: > On Wed, Nov 19, 2008 at 9:52 PM, David Chelimsky <[EMAIL PROTECTED]> wrote: >> On Wed, Nov 19, 2008 at 7:17 AM, Ramon Tayag <[EMAIL PROTECTED]> wrote: >>> I was reading some old posts on how we shouldn't test private methods,

Re: [rspec-users] Testing on enter state

2008-11-19 Thread Ramon Tayag
Not sure if I'm understanding right, but no, I can make the method public -- I just got used to methods, that aren't (or don't need to be) called by anything but its owner, being private. If I make it public it solves my question somewhat :) Thanks, Ramon Tayag On Wed, Nov 19, 2008 at 9:52 PM,

Re: [rspec-users] Testing on enter state

2008-11-19 Thread David Chelimsky
On Wed, Nov 19, 2008 at 7:17 AM, Ramon Tayag <[EMAIL PROTECTED]> wrote: > I was reading some old posts on how we shouldn't test private methods, > but there seemed to be an exception for states. > > When my model enters a state, a method is executed. (:on => Proc ...) > I just want to test this met

[rspec-users] Testing on enter state

2008-11-19 Thread Ramon Tayag
I was reading some old posts on how we shouldn't test private methods, but there seemed to be an exception for states. When my model enters a state, a method is executed. (:on => Proc ...) I just want to test this method. I couldn't find much material on it. How can I go about this? Thanks, Ram

Re: [rspec-users] mocking and stub comprehension

2008-11-19 Thread Sahyoun
Thanks Zach, Your suggestion has put me back on track. Cheers, Omar On 17 Nov 2008, at 00:13, Zach Dennis wrote: On Sun, Nov 16, 2008 at 5:53 PM, Sahyoun <[EMAIL PROTECTED]> wrote: Hello, I'm specing a controller, but having trouble getting my head around what I've created. I'm specing