title: How to access private attributes of a class?
body: <p>I can't access the private attributes/variables of an object for testing in rspec</p>
  
  <p>I've learned that you can access private methods like this: </p>
  
  <pre><code> expect(CLASS.send(METHOD_AS_SIMBOL,PARAM1,PARAM2…)).to eq(EXPECTED_RESULT)
  </code></pre>
  
  <p>But I can't make it work for attributes</p>
  
  <p>Edit:</p>
  
  <p>I feel uncomfortable with the idea of not testing private methods and attributes. I've read about not testing private code is beneficial because it forces the programmer to simplify classes and follow the Single responsibility principle. </p>
  
  <p>But somehow I feel the need to do it. It makes me feel that my code will be more solid if I test 100% of it. And I don't like the idea of being forced to follow some guidance by sacrificing what I perceive as code quality. I might be wrong though.</p>
  
  <p>Edit 2</p>
  
  <p>I don't want to test methods. I already know how to do it. Just instance variables.</p>