ohhhhh, I left in:<div><br class="webkit-block-placeholder"></div><div><div>&nbsp;&nbsp;it &quot;should return an error when passed a string&quot; do</div><div>&nbsp;&nbsp; &nbsp;@audience.stats = &#39;Market Goblin&#39;</div><div>&nbsp;&nbsp; &nbsp;lambda {@audience.stats = &#39;Market Goblin&#39;}.should raise_error</div>
<div>&nbsp;&nbsp;end</div><div><br class="webkit-block-placeholder"></div><div>when yours is:</div><div><br class="webkit-block-placeholder"></div><div><div>&nbsp;&nbsp;it &quot;should return an error when passed a string&quot; do</div><div>
&nbsp;&nbsp; &nbsp;lambda {@audience.stats = &#39;Market Goblin&#39;}.should raise_error</div><div>&nbsp;&nbsp;end</div></div><div><br class="webkit-block-placeholder"></div><div>I&#39;ve seen lambda before but not sure what it does.</div><div><br class="webkit-block-placeholder">
</div><br><div class="gmail_quote">On Jan 29, 2008 7:59 PM, Shane Mingins &lt;<a href="mailto:smingins@elctech.com">smingins@elctech.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">
Hmmmm<div><br></div><div>I just ran this and&nbsp;2 examples, 0 failures</div><div><br></div><div><div class="Ih2E3d"><div>class Audience</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;attr_accessor :stats</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;def initialize(name = nil,value = nil)&nbsp;</div>
<div>&nbsp;&nbsp; &nbsp;@name ||= &#39;all&#39;</div><div>&nbsp;&nbsp; &nbsp;@value ||= value</div><div>&nbsp;&nbsp;end</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;def stats=(flux)</div><div>&nbsp;&nbsp; &nbsp;@stats = @value * flux / 0.025</div><div>&nbsp;&nbsp;end</div><div><br></div><div>&nbsp;&nbsp;def market_share</div>
<div>&nbsp;&nbsp; &nbsp;&quot;The Market share is for #{@name} at a high of #{@stats}&quot;</div><div>&nbsp;&nbsp;end</div><div>&nbsp;&nbsp;</div><div>end</div><div><br></div><div><br></div><div>describe &quot;Audience.stats&quot; do</div><div>&nbsp;&nbsp;</div><div>
&nbsp;&nbsp;before :all do</div><div>&nbsp;&nbsp; &nbsp;@audience = Audience.new(nil,20)</div><div>&nbsp;&nbsp;end</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;it &nbsp;&quot;should have a stats of 80 when passed a flux of 10&quot; do</div><div>&nbsp;&nbsp; &nbsp;@audience.stats = 10</div><div>&nbsp;&nbsp; &nbsp;@audience.stats.should == 8000</div>
<div>&nbsp;&nbsp;end</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;it &quot;should return an error when passed a string&quot; do</div></div><div class="Ih2E3d"><div>&nbsp;&nbsp; &nbsp;lambda {@audience.stats = &#39;Market Goblin&#39;}.should raise_error</div></div><div>
&nbsp;&nbsp;end</div><div>&nbsp;&nbsp;</div><div>end</div><div class="Ih2E3d"><div><div>On 30/01/2008, at 1:55 PM, Andrew WC Brown wrote:</div><br><blockquote type="cite">try it, does the same thing =&#39;(<br><br><div class="gmail_quote"><br>
</div></blockquote></div><div><span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>
</span></span></span></span></span> </div><br></div></div></div><br>_______________________________________________<br>rspec-users mailing list<br><a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br></blockquote></div><br></div>