title: rspec `its` syntax with dynamic conditions
body: <p>I've been really loving using <code>contexts</code>, <code>subjects</code> and <code>its</code> with rspec to really clean up my test code.  Typical example:</p>
  <pre><code>context &quot;as a user&quot; do
    subject{ Factory :user }
  
    its(:name){ should == &quot;Bob&quot; }
  end
  </code></pre>
  <p>What I can't figure out though is how I could make this condition dynamic (ie. based on other objects).  <code>its</code> appears to instance eval the attribute within the block so I lose access to everything around it.  I'd love to do something like:</p>
  <pre><code>its(:name){ should == subject.contact.name }
  </code></pre>
  <p>But I can't see any way of achieving this.  Does anyone know if there is some a method proxied through to this instance eval that gives access to the origin object? Or if there's any other way I can use methods outside the scope of the instance of the attribute that I'm checking?</p>
  <h3>additional info</h3>
  <p>It seems as if <code>subject</code> within the <code>its</code> block gets changed to the actual attribute (<code>name</code> in this case)</p>
  <p>Interestingly, I have access to any of my <code>let</code> methods, but again, I don't have access to my original <code>subject</code> in question.</p>