Background just started programming in Ruby literally 12 hours ago and have a question regarding context and describe methods.&nbsp;&nbsp; Reading the RDoc it indicated that &quot;context&quot; is an alias for &quot;describe&quot;.&nbsp; So I decided to try to the following syntax seeing this is how I would approach it in C# with NBehave.<br>
require &#39;user&#39;<br><br>describe User do<br><br>&nbsp;&nbsp;&nbsp; before(:each) do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @user = User.new<br>&nbsp;&nbsp;&nbsp; end<br><br>&nbsp;&nbsp;&nbsp; context &quot;(adding assigned role)&quot; do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; before(:each) do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @user.assign_role(&quot;Manager&quot;)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; specify &quot;should be in any roles assigned to it&quot; do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @user.should be_in_role(&quot;Manager&quot;)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; specify &quot;should not be in any role not assigned to it&quot; do <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; @user.should_not be_in_role(&quot;unassigned role&quot;)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; end <br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; context &quot;(adding assigned group)&quot; do<br><br>&nbsp;&nbsp;&nbsp; end <br>end<br><br>I thought I could use the &quot;describe&quot; method&nbsp; to indicate the Type that the specifications where going to be concerning.&nbsp; I then would place the type into a behavioral context to assert the intended behavior against that context.<br>
<br>This combination resulted in User never being instantiated for the internal context.&nbsp; (nil:NilClass).&nbsp; However!&nbsp; If I flip the &quot;context&quot; and &quot;description&quot; it works.&nbsp; Am I doing something wrong?<br>
<br>require &#39;user&#39;<br><br>context User do<br>...<br>&nbsp;&nbsp;&nbsp; describe &quot;(adding assigned role)&quot; do<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; end <br>end<br><br>-- <br>God Bless,<br><br>Joe Ocampo<br><a href="http://agilejoe.lostechies.com">agilejoe.lostechies.com</a><br>
<br>&quot;How do you benefit if you gain the whole world &nbsp;but lose your soul in the process?&quot; Mark 8:36<br><br>