[rspec-users] RSpec Story - SystemStackError: stack level too deep

Ben Men lists at ruby-forum.com
Thu Jun 5 13:29:25 EDT 2008

I have a story that executes the following (as an example to show the
bug I'm experiencing):


  Given "I have a fake post saved" do
    @postCount = Post.find(:all).length
    @post = Post.new
      @post.employee_id = 123
    @post.name = "Name of the Post"
    @post.description = "Description of the Post"

  Given "I have visited some page" do

  When "I get some other page" do
    get('/posts/'+ at post.id)

  Then "my variable should still be set" do
    Post.find(:all).length.should == 1 + @postCount


It fails with "SystemStackError: stack level too deep" on the "When I
get some other page" bit.  If I remove the + at post.id bit, OR if I switch
the order execution of the Given statements, the story works.  What's
going on?  Is this a bug, or am I just missing something?

Additionally, I've tried updating to RSpec Edge by running
"script/plugin install git://github.com/dchelimsky/rspec", but I keep
receiving Plugin not found: ["git://github.com/dchelimsky/rspec"].
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list