<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On 30 July 2014 17:32, Sam Livingston-Gray <span dir="ltr"><<a href="mailto:geeksam@gmail.com" target="_blank">geeksam@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="">You might also find yourself wanting to separate out responsibilities by topic area, so that you wind up writing step code like:<br></div>
<div><br></div><div>step_driver.given.i_am_logged_in_as 'sales_rep'</div><div>step_driver.when.i_have_net_revenue '$20,000'</div><div>step_driver.when.commissions_are_calculated</div><div>step_driver.then.i_receive_payout_of '$5'</div>
</div></div></div></blockquote><div><br></div><div style="font-family:arial,sans-serif;font-size:13px">I don’t get the benefit of this; all that step_driver.[giv|[w|t]h]en seems sort of noisy.  Why would you do that instead of just something like:</div>
<div style="font-family:arial,sans-serif;font-size:13px"><div> </div>i_am_logged_in_as 'sales_rep'<br><div><div class="gmail_extra"><div class="gmail_quote">i_have_net_revenue '$20,000'</div></div></div><div>
<br></div><div><div class="gmail_extra"><div class="gmail_quote"><div>calculate_commissions</div><div></div></div></div></div><div> </div>i_should_receive_payout_of '$5’</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">I admit, I’m not exactly clear on what problem Paul was originally describing, nor am I clear anymore if we’re talking about cucumber or rspec features.  If we’re talking cucumber, then it doesn’t seem so awful as the actual step name is what we’ll see in the test so these extra objects and methods are not in the way.  However, if we’re talking rspec features then I don’t understand the motivation for introducing the line noise as it reduces the readability of the spec.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I’m sure there’s a good reason and I’m just missing something.</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div><span style="font-family:arial,sans-serif;font-size:13px">Forgive the use of the “should” in my re-write, but I couldn’t think of a better word to indicate that the final method is an assertion.  Perhaps this is enough motivation for the noise?</span></div>
</div></div></div>