@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
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
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
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
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
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.
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
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
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