rspec/rspec-mocks — pull request #263 by JonRowe (2013-06-22 09:33:47+00:00)
Title: .any_instance.and_call_original throws NilError

Original code:

```` ruby
Git::Base.any_instance.stub(:object).and_call_original
Git::Base.any_instance.stub(:object).with('2dc20c984283bede1f45863b8f3b4dd9b5b554cc^{tree}:file-en.svg').
and_return(mock('Git::Object::Blob', contents: @svg))
````

Error:

````

Failure/Error: Git::Base.any_instance.stub(:object).and_call_original
NoMethodError:
undefined method `include?' for nil:NilClass
# /Users/tim/.rvm/gems/ruby-1.9.3-p392@shuttle/gems/rspec-mocks-2.13.0/lib/rspec/mocks/any_instance/stub_chain.rb:31:in `verify_invocation_order'
# /Users/tim/.rvm/gems/ruby-1.9.3-p392@shuttle/gems/rspec-mocks-2.13.0/lib/rspec/mocks/any_instance/chain.rb:71:in `record'
# /Users/tim/.rvm/gems/ruby-1.9.3-p392@shuttle/gems/rspec-mocks-2.13.0/lib/rspec/mocks/any_instance/chain.rb:18:in `and_call_original'
# ./spec/controllers/commits_controller_spec.rb:277:in `block (3 levels) in '
````

Values in `#verify_invocation_order` at time of exception:

```` ruby
invocation_order = {:stub=>[nil], :with=>[:stub], :and_return=>[:with, :stub], :and_raise=>[:with, :stub], :and_yield=>[:with, :stub]}

rspec_method_name = :and_call_original
````