On Apr 27, 2011, at 3:55 PM, Sergio Ruiz wrote:
> i am setting up a few objects that are interrelated for use in an rspec
> test..
>
> something like:
>
> describe Dimension do
>
> before(:each) do
> text = "string here"
> end
>
> it "should puts string" do
> puts text
> end
>
> end
>
> when
wow! thanks so much for the great info!
this is exactly what i needed!
thanks again!
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Wow! I guess this thread beated the record for simultaneous answers! :D
Best regards!
Rodrigo.
Em 27-04-2011 16:55, Sergio Ruiz escreveu:
i am setting up a few objects that are interrelated for use in an rspec
test..
something like:
describe Dimension do
before(:each) do
text = "string he
Hi,
On 27 Apr 2011, at 20:55, Sergio Ruiz wrote:
> i am setting up a few objects that are interrelated for use in an rspec
> test..
>
> something like:
>
> describe Dimension do
>
> before(:each) do
> text = "string here"
This defines a local variable 'text' which lives for the duration of th
Sergio,
I believe you need to make text an instance variable:
@text = "string here"
Or you could use a let block:
let(:text) do
"string "here"
end
Then you could continue to reference the text variable as you do now.
Jon Homan
On Wed, Apr 27, 2011 at 2:55 PM, Sergio Ruiz
On Wed, Apr 27, 2011 at 2:55 PM, Sergio Ruiz wrote:
> i am setting up a few objects that are interrelated for use in an rspec
> test..
>
> something like:
>
> describe Dimension do
>
> before(:each) do
> text = "string here"
> end
>
> it "should puts string" do
> puts text
> end
>
> end
>
> whe
On Apr 27, 2011, at 3:55 PM, Sergio Ruiz wrote:
> i am setting up a few objects that are interrelated for use in an rspec
> test..
>
> something like:
>
> describe Dimension do
>
> before(:each) do
> text = "string here"
> end
>
> it "should puts string" do
> puts text
> end
>
> end
>
> when
On 28/04/11 1:25 AM, Sergio Ruiz wrote:
i am setting up a few objects that are interrelated for use in an rspec
test..
something like:
describe Dimension do
before(:each) do
text = "string here"
end
it "should puts string" do
puts text
end
end
when i run this, i get an error: undefined
Your variable "text" doesn't exist outside the before(:each) loop. Replacing
text with @text should fix your problem.
-- Bouke
2011/4/27 Sergio Ruiz
> i am setting up a few objects that are interrelated for use in an rspec
> test..
>
> something like:
>
> describe Dimension do
>
> before(:each)