Re: [rspec-users] before(:each) <- need some clarification

2011-04-27 Thread Rodrigo Rosenfeld Rosas
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

Re: [rspec-users] new goodness, Capybara::RSpecMatchers in helper specs

2011-04-27 Thread David Chelimsky
On Apr 26, 2011, at 8:54 AM, juwalter wrote: > This > https://github.com/rspec/rspec-rails/commit/59793dcc349b64f4ebcf742606371001256c774d > is exciting news!! ("this adds capybara matchers to view and helper > specs") > > Now, if I just knew how to take advantage of it? Do I have to require > s

Re: [rspec-users] before(:each) <- need some clarification

2011-04-27 Thread Matt Wynne
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

Re: [rspec-users] Slow test suite with Ruby 1.9.2 and Rspec 2.5

2011-04-27 Thread Ernie Miller
On Apr 25, 9:19 am, Alisson Sales wrote: > I've found the problem. The gem meta_where > (https://github.com/ernie/meta_where) is doing something wrong in ruby > 1.9.2, just removing it from my Gemfile and my suite is running fast > again(6 seconds). > > Thank you guys, I'll open a issue on the met

Re: [rspec-users] before(:each) <- need some clarification

2011-04-27 Thread Jon Homan
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

Re: [rspec-users] before(:each) <- need some clarification

2011-04-27 Thread David Kahn
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

Re: [rspec-users] before(:each) <- need some clarification

2011-04-27 Thread David Chelimsky
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

Re: [rspec-users] before(:each) <- need some clarification

2011-04-27 Thread Srushti Ambekallu
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

Re: [rspec-users] before(:each) <- need some clarification

2011-04-27 Thread Bouke Woudstra
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)

[rspec-users] new goodness, Capybara::RSpecMatchers in helper specs

2011-04-27 Thread juwalter
This https://github.com/rspec/rspec-rails/commit/59793dcc349b64f4ebcf742606371001256c774d is exciting news!! ("this adds capybara matchers to view and helper specs") Now, if I just knew how to take advantage of it? Do I have to require something else in spec_helper? I have already added included

[rspec-users] before(:each) <- need some clarification

2011-04-27 Thread 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) do text = "string here" end it "should puts string" do puts text end end when i run this, i get an error: undefined local variable or method `text' am doing so

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-27 Thread Matthew Van Horn
On Apr 27, 2011, at 6:40 AM, David Chelimsky wrote: > > On Apr 26, 2011, at 5:39 PM, Matthew Van Horn wrote: > >> >> On Apr 26, 2011, at 4:02 PM, Rodrigo Rosenfeld Rosas wrote: >> >>> Ok, now I understand what is your issue. >>> >> class Foo >> end >> >> class Bar >> d

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-27 Thread David Chelimsky
On Apr 26, 2011, at 5:39 PM, Matthew Van Horn wrote: > > On Apr 26, 2011, at 4:02 PM, Rodrigo Rosenfeld Rosas wrote: > >> Ok, now I understand what is your issue. >> > class Foo > end > > class Bar > def self.my_foo > @my_foo ||= Foo.new > end > def s