[rspec-devel] pending caller

David Chelimsky dchelimsky at gmail.com
Wed Apr 1 02:07:05 EDT 2009

Hi all,

The rspec-1.2.2 release cleaned up what gets passed to formatters,
introducing ExampleGroupProxy and ExampleProxy objects that each
export description() and location():

description is the docstring passed to describe() and it() or any of
their aliases
location is the filename and line number where the group or example was declared

Currently the formatters have an example_pending method:

example_pending(example_proxy, message, pending_location)

The pending_location (previously pending_caller) is the file and line
number where the pending statement is declared, as opposed to the
location of the example. So in this case:

describe "subject" do
  it "does something" do
    pending "a fix" do
      subject.should_not be_broken

example_group.location is line 1
example.location is line 2
pending_location is line 3

I'm thinking that now that example_group.location and example.location
are consistent, that pending_location is redundant even though it's a
different line.

Of course the problem here is how to effectively deprecate
pending_location, but that's another matter :)

Any thoughts about this?

-- David

More information about the rspec-devel mailing list