[rspec-devel] [ rspec-Bugs-6577 ] messy mock backtrace when frozen to edge rails

noreply at rubyforge.org noreply at rubyforge.org
Fri Nov 24 17:08:40 EST 2006


Bugs item #6577, was opened at 2006-11-08 22:53
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6577&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Jay Levitt (jaylev)
Assigned to: Nobody (None)
Summary: messy mock backtrace when frozen to edge rails

Initial Comment:
Once I freeze edge rails with rake rails:freeze:edge - even if I freeze it to 1.1.6 - the following app and spec cause a messy backtrace.  This does not happen when rails is unfrozen.

# app/controllers/test_controller.rb

class TestController < ActionController::Base

  def index
    tm = TestMock.new
    tm.foo
    tm.bar
  end
end

class TestMock
  def foo
  end
end

# spec/controllers/one_spec.rb

require File.dirname(__FILE__) + '/../spec_helper'

context "the test app" do
  controller_name :test

  specify "should render the index page" do
    tm = mock("TestMock")
    TestMock.stub!(:new).and_return(tm)
    tm.should_receive(:foo)
    get 'index'
  end
end

# backtrace shown

$ spec spec/controllers/one_spec.rb 

F

1)
Spec::Mocks::MockExpectationError in 'the test app should render the index page'
Mock 'TestMock' received unexpected message :bar
/cygdrive/c/dev/src/eclipse/testapp/config/../app/controllers/test_controller.rb:6:in `index'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/base.rb:1070:in `send'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/base.rb:1070:in `perform_action_without_filters'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:635:in `call_filter'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:622:in `perform_action_without_benchmark'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/rescue.rb:81:in `perform_action'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/base.rb:427:in `send'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/base.rb:427:in `process_without_filters'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/filters.rb:627:in `process_without_session_management_support'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in `process_without_test'
/cygdrive/c/dev/src/eclipse/testapp/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:15:in `process'
./spec/controllers/one_spec.rb:10:in `should render the index page'

Finished in 0.197 seconds

1 specification, 1 failure



----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2006-11-24 22:08

Message:
Moving to patches.

----------------------------------------------------------------------

Comment By: Jay Levitt (jaylev)
Date: 2006-11-09 01:25

Message:
Easier done than said!

----------------------------------------------------------------------

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2006-11-08 23:44

Message:
I think this can be fixed with a tweak in backtrace_tweaker.rb
Could you try to create a patch since you already have the environment up?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=6577&group_id=797


More information about the rspec-devel mailing list