Skip to content

Instantly share code, notes, and snippets.

@txus
Created December 7, 2010 10:25
Show Gist options
  • Save txus/731650 to your computer and use it in GitHub Desktop.
Save txus/731650 to your computer and use it in GitHub Desktop.
Failure/Error: subject.user.should == existing_user
private method `pretty_print' called for #<RSpec::Mocks::ErrorGenerator:0x00000106168148>
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:154:in `block in pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:154:in `pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:236:in `block (3 levels) in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:234:in `block (2 levels) in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:223:in `block in seplist'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:217:in `each'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:217:in `seplist'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:229:in `block in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:178:in `object_address_group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:228:in `pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:298:in `pretty_print'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:154:in `block in pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:154:in `pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:236:in `block (3 levels) in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:234:in `block (2 levels) in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:223:in `block in seplist'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:217:in `each'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:217:in `seplist'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:229:in `block in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:178:in `object_address_group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:228:in `pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:298:in `pretty_print'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:154:in `block in pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:154:in `pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:236:in `block (3 levels) in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:234:in `block (2 levels) in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:223:in `block in seplist'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:217:in `each'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:217:in `seplist'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:229:in `block in pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:178:in `object_address_group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:228:in `pp_object'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:298:in `pretty_print'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:154:in `block in pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:199:in `block (2 levels) in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:225:in `nest'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:198:in `block in group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:210:in `group_sub'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/prettyprint.rb:197:in `group'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:154:in `pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:77:in `block in pp'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:121:in `guard_inspect_key'
# /Users/txus/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/pp.rb:77:in `pp'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-expectations-2.2.0/lib/rspec/expectations/differ.rb:45:in `diff_as_object'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-expectations-2.2.0/lib/rspec/expectations/fail_with.rb:25:in `fail_with'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-expectations-2.2.0/lib/rspec/matchers/operator_matcher.rb:48:in `fail_with_message'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-expectations-2.2.0/lib/rspec/matchers/operator_matcher.rb:70:in `__delegate_operator'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-expectations-2.2.0/lib/rspec/matchers/operator_matcher.rb:60:in `eval_match'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-expectations-2.2.0/lib/rspec/matchers/operator_matcher.rb:29:in `block in use_custom_matcher_or_delegate'
# ./spec/models/attendee_spec.rb:25:in `block (5 levels) in <top (required)>'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example.rb:40:in `instance_eval'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example.rb:40:in `block (2 levels) in run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example.rb:88:in `with_around_hooks'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example.rb:37:in `block in run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example.rb:81:in `block in with_pending_capture'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example.rb:80:in `catch'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example.rb:80:in `with_pending_capture'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example.rb:36:in `run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:261:in `block in run_examples'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:257:in `map'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:257:in `run_examples'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:231:in `run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `block in run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `map'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `block in run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `map'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `block in run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `map'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/example_group.rb:232:in `run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/command_line.rb:27:in `block (2 levels) in run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/command_line.rb:27:in `map'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/command_line.rb:27:in `block in run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/reporter.rb:12:in `report'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/command_line.rb:24:in `run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/runner.rb:55:in `run_in_process'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/runner.rb:46:in `run'
# /Users/txus/.rvm/gems/ruby-1.9.2-p0@confly/gems/rspec-core-2.2.1/lib/rspec/core/runner.rb:10:in `block in autorun'
@txus
Copy link
Author

txus commented Jul 6, 2011

It seems that it eventually worked without changing a line (now that part of the code is the same). The working version of that spec uses RSpec 2.3.0, and the failing was using 2.2.1.
Maybe it is a bug reintroduced somewhere between 2.3 and 2.6? You should try activating RSpec 2.3.0 in your Gemfile. Keep me posted!

Copy link

ghost commented Jul 20, 2011

I'm also running into this, tried 2.3, 2.4, 2.5 and 2.6.

@blakesmith
Copy link

This exception goes away when the test actually passes, but I never got to the root cause.

@jmccartie
Copy link

I just ran into this and fixed the issue. (no idea if this applies to anyone else).

I had:


But the object called only had one order method being called. Once I removed the extra/ order from stub_chain, the test passed and all was fine.

@ryanjones
Copy link

I got similar error this when I was doing this:
--BAD SYNTAX-- assert_response redirect_to(forums_url) --BAD SYNTAX--

When I should have been doing this:
response.should be_redirect(forums_url)

Calls:
flunk(build_message(message, "Expected response to be a , but was ", type, @response.response_code))

Which calls:
template.gsub(/\G((?:[^]|.)*?)()??/) { $1 + ($2 ? "?" : mu_pp(arguments.shift)) } (mu_pp bombs out)

Seems to be fine once you fix the broken test.

@mildavw
Copy link

mildavw commented May 9, 2013

Pretty Print is calling #inspect on an object without a #to_s.

Add this to your class:

def to_s
  "something you want to see when this is inspected"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment