Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


ExampleGroup.its(:my_method) should create Example in which subject is modified #22

gsterndale opened this Issue · 4 comments

2 participants

Greg Sterndale David Chelimsky
Greg Sterndale

Calling subject inside the example_block should return a modified subject.

The first argument to its() should be a symbol representing a method name to be called on subject.

For example, the following should pass:

class Foo
  def bar; 'fizz'; end
describe Foo do
  its(:bar) { should == 'fizz' }

Accessing the subject in a before or after block should be on the implicit or explicit subject, NOT the modified subject. See

Greg Sterndale

The following commits demonstrate one possible implementation:

I'm sternicus on IRC. Hit me up if you'd like me to change anything.

David Chelimsky

I merged these commits to a branch and made some modifictations:

Feel free to comment on the commit

Greg Sterndale

Great! I add a couple minor comments in your commit. Thanks.

David Chelimsky

Closed by c2df11a

Tim Harper timcharper referenced this issue from a commit in timcharper/rspec-core
Greg Sterndale gsterndale ExampleGroup .its() creates new Example with a subject modifier
Closes #22
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.