Re: [wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-03-05 Thread Ethan
@countries is an instance variable of whatever 'self' is in the scope where @countries is used. I don't know if that ends up being the same object inside the 'describe' block and the 'it' blocks, but it sounds like it's not. one simple test would be just to add puts self.inspect to the beginning

Re: [wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-03-04 Thread Alan Baird
Adam - I think the problem is here: it should contain a table with links do @browser.table(:class, /example/).links.each do |link| @countries [link.text, link.href] end #links @countries.should_not be_empty end #it You are defining @countries in this method

[wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-03-01 Thread Adam Reed
I'm at it again! Having some trouble completing an RSpec script with a pretty simple concept -- mostly having trouble with the hierarchy of it all. Basically, I have a single page with many links. Each link points the same type of template with a different title. The script stores these links

[wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-02-25 Thread Jarmo Pertman
First of all - RSpec is a good choice :) I wouldn't use so many nested describe blocks - it makes it hard to understand, what before and after blocks are run at which time and so on. Just keep one describe block or create different describe blocks. Also, I would lose shared_examples for this

[wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-02-25 Thread Jarmo Pertman
I'm answering into the group directly - maybe someone else finds this also useful. Think of the helpers as a collection of methods which will be used throughout the tests. You could do many modules. Some modules would be specific to your current application under test and some others would be

[wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-02-25 Thread Adam Reed
Thanks Jarmo! There are a lot of similarities between this format and what I was previously doing with Watir, as well as some good new information. I think learning the new material for RSpec put a stimga of sorts on the organization and these replies definitely cleared a few things up for me.

[wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-02-24 Thread Adam Reed
Thanks Željko! 1. I used the require 'spec' so that I could execute the script in SciTE to check for simple errors before running spec from the command line. To your point, I will make sure not to include it on future scripts. 2. Agree with you on the before(:all)/(:each) - I'm still figuring

[wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-02-24 Thread Adam Reed
Thanks Željko! 1. I used the require 'spec' so that I could execute the script in SciTE to check for simple errors before running spec from the command line. To your point, I will make sure not to include it on future scripts. 2. Agree with you on the before(:all)/(:each) - I'm still figuring

Re: [wtr-general] Re: Switching from Test::Unit to RSpec - tips/gotchas? Short code review.

2010-02-24 Thread marekj
On Wed, Feb 24, 2010 at 11:12 AM, Adam Reed reed.a...@gmail.com wrote: Thanks Željko! 1.  I used the require 'spec' so that I could execute the script in SciTE to check for simple errors before running spec from the command line.  To your point, I will make sure not to include it on future