<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-17459</id>
	<title>Nabble - RSpec</title>
	<updated>2009-12-22T14:08:49Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/RSpec-f17459.xml;edit/" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/RSpec-f17459.html" />
	<subtitle type="html">&lt;a href=&quot;http://rspec.rubyforge.org/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;RSpec&lt;/a&gt;&amp;nbsp;is a framework for practicing Behaviour Driven Development (BDD) in Ruby.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26895103</id>
	<title>Re: no should raise_exception</title>
	<published>2009-12-22T14:08:49Z</published>
	<updated>2009-12-22T14:08:49Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Tue, Dec 22, 2009 at 9:33 AM, rogerdpack &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26895103&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rogerpack2005@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex&quot;&gt;

&lt;div&gt;&amp;gt; raise_error already catches any type of exception, error or not:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;   class BlahException &amp;lt; Exception; end&lt;br&gt;
&amp;gt;   class BlahError &amp;lt; StandardError; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;   lambda { raise BlahException }.should raise_error(BlahException)&lt;br&gt;
&amp;gt;   lambda { raise BlahError }.should raise_error(BlahError)&lt;br&gt;
&amp;gt;   lambda { raise &amp;quot;blah&amp;quot; }.should raise_error(RuntimeError, &amp;quot;blah&amp;quot;)&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Thanks for the response.  I think my request was more of a &amp;quot;why call&lt;br&gt;
them errors--in my head one doesn&amp;#39;t raise errors--one raises&lt;br&gt;
exceptions and interprets them as errors, so allowing for the syntax&lt;br&gt;
raise_exception would be more mind friendly to me.&amp;quot;&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;What I really want to say is &amp;quot;should raise(Blah)&amp;quot; but Ruby already defines raise as a keyword :)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;I&amp;#39;d be open to aliasing raise_error with raise_exception, renaming it to raise_exception and aliasing raise_error for compatibility, but I think this might just add confusion rather than clarifying intent. Thoughts?&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;David&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex&quot;&gt;&lt;font color=&quot;#888888&quot;&gt;-r&lt;br&gt;&lt;/font&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26895103&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/no-should-raise_exception-tp26861103p26895103.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26892591</id>
	<title>Re: class variables different between spec and runtime?</title>
	<published>2009-12-22T10:51:45Z</published>
	<updated>2009-12-22T10:51:45Z</updated>
	<author>
		<name>Peter Fitzgibbons</name>
	</author>
	<content type="html">DOH!&lt;br&gt;Thanks David,&lt;br&gt;&lt;br&gt;Happy Holidays!&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;Peter Fitzgibbons&lt;br&gt;(847) 687-7646&lt;br&gt;Email: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;IM GTalk: peter.fitzgibbons&lt;br&gt;IM AOL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;

&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Dec 22, 2009 at 9:24 AM, David Chelimsky &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dchelimsky@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div class=&quot;im&quot;&gt;On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dchelimsky@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div&gt;On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;

&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Hello Folks,&lt;br&gt;&lt;br&gt;This gist &lt;a href=&quot;http://gist.github.com/261791&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/261791&lt;/a&gt; has an example user.rb, user_spec.rb&lt;br&gt;At runtime, this snippet fails&lt;br&gt;&lt;br&gt;u = User.find(123)&lt;br&gt;

u.update_with_profile({...})&lt;br&gt;

The error occurred while evaluating nil.select):&lt;br&gt;  app/models/user.rb:6:in `moderator_fields&amp;#39;&lt;br&gt;  app/models/user.rb:118:in `update_with_profile&amp;#39;&lt;br&gt;&lt;br&gt;The spec passes all-green.&lt;br&gt;&lt;br&gt;Could you tell me how this might be ?&lt;br&gt;


&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;The user in the spec comes from new_with_profile(), which sets instance variables on the User class.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The user in the console comes from find(), and those ivars are not yet set.&lt;/div&gt;

&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Also - @params in the User class (in the class methods) is not the same @params in the User instances (in update_with_profile).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;HTH,&lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;David&lt;/font&gt;&lt;/div&gt;
&lt;div class=&quot;im&quot;&gt;&lt;div&gt; &lt;/div&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;div class=&quot;gmail_quote&quot;&gt;
&lt;div&gt; &lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;div&gt;
&lt;br&gt;Thanks,&lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;br clear=&quot;all&quot;&gt;Peter Fitzgibbons&lt;br&gt;(847) 687-7646&lt;br&gt;Email: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;IM GTalk: peter.fitzgibbons&lt;br&gt;


IM AOL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;

&lt;/font&gt;&lt;br&gt;&lt;/div&gt;_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;br&gt;_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26892591&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/class-variables-different-between-spec-and-runtime--tp26889846p26892591.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890872</id>
	<title>Re: concept of given</title>
	<published>2009-12-22T08:34:59Z</published>
	<updated>2009-12-22T08:34:59Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Dec 22, 2009 at 10:31 AM, rogerdpack &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890872&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rogerpack2005@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
&amp;gt; context &amp;quot;given a certain set of paths&amp;quot; do&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Ahh so it&amp;#39;s called context.&lt;br&gt;
&lt;br&gt;
Cool (though I&amp;#39;ll admit that naming it &amp;quot;given&amp;quot; can make it sound more&lt;br&gt;
like an English sentence, so an alias would be a suggestion).&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://gist.github.com/206969&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/206969&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m not adding that to rspec though, as we already have enough confusion just between context and describe :)&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Cheers,&lt;br&gt;David&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;Much thanks.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;-r&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890872&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/concept-of-given-tp26890138p26890872.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890835</id>
	<title>Re: concept of given</title>
	<published>2009-12-22T08:31:04Z</published>
	<updated>2009-12-22T08:31:04Z</updated>
	<author>
		<name>rogerdpack</name>
	</author>
	<content type="html">&lt;br&gt;&amp;gt; context &amp;quot;given a certain set of paths&amp;quot; do
&lt;br&gt;&lt;br&gt;Ahh so it's called context.
&lt;br&gt;&lt;br&gt;Cool (though I'll admit that naming it &amp;quot;given&amp;quot; can make it sound more
&lt;br&gt;like an English sentence, so an alias would be a suggestion).
&lt;br&gt;&lt;br&gt;Much thanks.
&lt;br&gt;-r
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890835&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/concept-of-given-tp26890138p26890835.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890697</id>
	<title>Re: concept of given</title>
	<published>2009-12-22T08:19:08Z</published>
	<updated>2009-12-22T08:19:08Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Tue, Dec 22, 2009 at 10:15 AM, Rick DeNatale &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890697&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rick.denatale@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;On Tue, Dec 22, 2009 at 10:38 AM, David Chelimsky &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890697&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dchelimsky@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt; On Tue, Dec 22, 2009 at 9:35 AM, rogerdpack &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890697&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rogerpack2005@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Forgive me if the question is a common one...&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; does rspec have any concept like&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; given &amp;quot;a certain set of paths&amp;quot; do&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt;  it &amp;quot;should be able to recreate them&amp;quot; do; end&lt;br&gt;
&amp;gt;&amp;gt;  it &amp;quot;...&amp;quot;; end&lt;br&gt;
&amp;gt;&amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Not built into rspec. There is a merb extension that does that, but there is&lt;br&gt;
&amp;gt; no &amp;quot;when&amp;quot; and &amp;quot;then&amp;quot; counterpart, so I didn&amp;#39;t want to add it to rspec.&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;It looks like that merb extension was about injecting a part of a&lt;br&gt;
before block by adding an option to describe, yes?&lt;br&gt;
&lt;a href=&quot;http://www.mail-archive.com/rspec-users@rubyforge.org/msg07327.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/rspec-users@.../msg07327.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
I don&amp;#39;t see that that&amp;#39;s what Roger is asking for though. It seems to&lt;br&gt;
me that he&amp;#39;s asking more for yet another synonym for describe or&lt;br&gt;
context.&lt;br&gt;
&lt;br&gt;
In which case I&amp;#39;d suggest just using describe or context as in:&lt;br&gt;
&lt;br&gt;
context &amp;quot;given a certain set of paths&amp;quot; do&lt;br&gt;
before(:each) do&lt;br&gt;
   # code to set up the paths however the included specs need them, e.g.&lt;br&gt;
   @paths = [&amp;quot;a/b&amp;quot;, &amp;quot;c/d&amp;quot;]&lt;br&gt;
 end&lt;br&gt;
&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
   it &amp;quot;should be able to recreate them&amp;quot; do; end&lt;br&gt;
   it &amp;quot;...&amp;quot;; end&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;I tend to use describe for the top level, and context when nested.&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Ah - I see what you mean. Though, I tend to use describe() for nouns and context for context.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;describe &amp;quot;something&amp;quot; do&lt;/div&gt;&lt;div&gt;  context &amp;quot;in some state&amp;quot; do&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Usuall that works out that the outer block starts w/ describe and the inner starts w/ context, but sometimes there are describe blocks nested within describe blocks as well.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;font color=&quot;#888888&quot;&gt;--&lt;br&gt;
Rick DeNatale&lt;br&gt;
&lt;br&gt;
Blog: &lt;a href=&quot;http://talklikeaduck.denhaven2.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://talklikeaduck.denhaven2.com/&lt;/a&gt;&lt;br&gt;
Twitter: &lt;a href=&quot;http://twitter.com/RickDeNatale&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://twitter.com/RickDeNatale&lt;/a&gt;&lt;br&gt;
WWR: &lt;a href=&quot;http://www.workingwithrails.com/person/9021-rick-denatale&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.workingwithrails.com/person/9021-rick-denatale&lt;/a&gt;&lt;br&gt;
LinkedIn: &lt;a href=&quot;http://www.linkedin.com/in/rickdenatale&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/in/rickdenatale&lt;/a&gt;&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890697&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890697&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/concept-of-given-tp26890138p26890697.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890647</id>
	<title>Re: concept of given</title>
	<published>2009-12-22T08:15:53Z</published>
	<updated>2009-12-22T08:15:53Z</updated>
	<author>
		<name>Rick DeNatale</name>
	</author>
	<content type="html">On Tue, Dec 22, 2009 at 10:38 AM, David Chelimsky &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890647&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dchelimsky@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Tue, Dec 22, 2009 at 9:35 AM, rogerdpack &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890647&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rogerpack2005@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Forgive me if the question is a common one...
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; does rspec have any concept like
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; given &amp;quot;a certain set of paths&amp;quot; do
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;  it &amp;quot;should be able to recreate them&amp;quot; do; end
&lt;br&gt;&amp;gt;&amp;gt;  it &amp;quot;...&amp;quot;; end
&lt;br&gt;&amp;gt;&amp;gt; end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Not built into rspec. There is a merb extension that does that, but there is
&lt;br&gt;&amp;gt; no &amp;quot;when&amp;quot; and &amp;quot;then&amp;quot; counterpart, so I didn't want to add it to rspec.
&lt;/div&gt;&lt;br&gt;It looks like that merb extension was about injecting a part of a
&lt;br&gt;before block by adding an option to describe, yes?
&lt;br&gt;&lt;a href=&quot;http://www.mail-archive.com/rspec-users@rubyforge.org/msg07327.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.mail-archive.com/rspec-users@.../msg07327.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;I don't see that that's what Roger is asking for though. It seems to
&lt;br&gt;me that he's asking more for yet another synonym for describe or
&lt;br&gt;context.
&lt;br&gt;&lt;br&gt;In which case I'd suggest just using describe or context as in:
&lt;br&gt;&lt;br&gt;context &amp;quot;given a certain set of paths&amp;quot; do
&lt;br&gt;before(:each) do
&lt;br&gt;&amp;nbsp; &amp;nbsp;# code to set up the paths however the included specs need them, e.g.
&lt;br&gt;&amp;nbsp; &amp;nbsp;@paths = [&amp;quot;a/b&amp;quot;, &amp;quot;c/d&amp;quot;]
&lt;br&gt;&amp;nbsp;end
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;it &amp;quot;should be able to recreate them&amp;quot; do; end
&lt;br&gt;&amp;nbsp; &amp;nbsp;it &amp;quot;...&amp;quot;; end
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;I tend to use describe for the top level, and context when nested.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Rick DeNatale
&lt;br&gt;&lt;br&gt;Blog: &lt;a href=&quot;http://talklikeaduck.denhaven2.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://talklikeaduck.denhaven2.com/&lt;/a&gt;&lt;br&gt;Twitter: &lt;a href=&quot;http://twitter.com/RickDeNatale&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://twitter.com/RickDeNatale&lt;/a&gt;&lt;br&gt;WWR: &lt;a href=&quot;http://www.workingwithrails.com/person/9021-rick-denatale&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.workingwithrails.com/person/9021-rick-denatale&lt;/a&gt;&lt;br&gt;LinkedIn: &lt;a href=&quot;http://www.linkedin.com/in/rickdenatale&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/in/rickdenatale&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890647&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/concept-of-given-tp26890138p26890647.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890171</id>
	<title>Re: concept of given</title>
	<published>2009-12-22T07:38:12Z</published>
	<updated>2009-12-22T07:38:12Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Tue, Dec 22, 2009 at 9:35 AM, rogerdpack &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890171&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rogerpack2005@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
Forgive me if the question is a common one...&lt;br&gt;
&lt;br&gt;
does rspec have any concept like&lt;br&gt;
&lt;br&gt;
given &amp;quot;a certain set of paths&amp;quot; do&lt;br&gt;
&lt;br&gt;
  it &amp;quot;should be able to recreate them&amp;quot; do; end&lt;br&gt;
  it &amp;quot;...&amp;quot;; end&lt;br&gt;
end&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Not built into rspec. There is a merb extension that does that, but there is no &amp;quot;when&amp;quot; and &amp;quot;then&amp;quot; counterpart, so I didn&amp;#39;t want to add it to rspec.&lt;/div&gt;&lt;div&gt;
&lt;br&gt;&lt;/div&gt;&lt;div&gt;HTH,&lt;br&gt;David&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;?&lt;br&gt;
Thanks.&lt;br&gt;
-r&lt;br&gt;
_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890171&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890171&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/concept-of-given-tp26890138p26890171.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890150</id>
	<title>Re: class variables different between spec and runtime?</title>
	<published>2009-12-22T07:36:01Z</published>
	<updated>2009-12-22T07:36:01Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Tue, Dec 22, 2009 at 9:30 AM, Rick DeNatale &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890150&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rick.denatale@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;Also counting on class variables to retain state in Rails is a recipe&lt;/div&gt;
for disaster.&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Did you read that in rails recipes?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;:-/&lt;/div&gt;&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890150&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/class-variables-different-between-spec-and-runtime--tp26889846p26890150.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890138</id>
	<title>concept of given</title>
	<published>2009-12-22T07:35:18Z</published>
	<updated>2009-12-22T07:35:18Z</updated>
	<author>
		<name>rogerdpack</name>
	</author>
	<content type="html">Forgive me if the question is a common one...
&lt;br&gt;&lt;br&gt;does rspec have any concept like
&lt;br&gt;&lt;br&gt;given &amp;quot;a certain set of paths&amp;quot; do
&lt;br&gt;&lt;br&gt;&amp;nbsp; it &amp;quot;should be able to recreate them&amp;quot; do; end
&lt;br&gt;&amp;nbsp; it &amp;quot;...&amp;quot;; end
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;?
&lt;br&gt;Thanks.
&lt;br&gt;-r
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890138&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/concept-of-given-tp26890138p26890138.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890102</id>
	<title>Re: no should raise_exception</title>
	<published>2009-12-22T07:33:30Z</published>
	<updated>2009-12-22T07:33:30Z</updated>
	<author>
		<name>rogerdpack</name>
	</author>
	<content type="html">&amp;gt; raise_error already catches any type of exception, error or not:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;   class BlahException &amp;lt; Exception; end
&lt;br&gt;&amp;gt;   class BlahError &amp;lt; StandardError; end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;   lambda { raise BlahException }.should raise_error(BlahException)
&lt;br&gt;&amp;gt;   lambda { raise BlahError }.should raise_error(BlahError)
&lt;br&gt;&amp;gt;   lambda { raise &amp;quot;blah&amp;quot; }.should raise_error(RuntimeError, &amp;quot;blah&amp;quot;)
&lt;br&gt;&lt;br&gt;Thanks for the response. &amp;nbsp;I think my request was more of a &amp;quot;why call
&lt;br&gt;them errors--in my head one doesn't raise errors--one raises
&lt;br&gt;exceptions and interprets them as errors, so allowing for the syntax
&lt;br&gt;raise_exception would be more mind friendly to me.&amp;quot;
&lt;br&gt;&lt;br&gt;-r
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890102&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/no-should-raise_exception-tp26861103p26890102.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26890067</id>
	<title>Re: class variables different between spec and runtime?</title>
	<published>2009-12-22T07:30:41Z</published>
	<updated>2009-12-22T07:30:41Z</updated>
	<author>
		<name>Rick DeNatale</name>
	</author>
	<content type="html">On Tue, Dec 22, 2009 at 10:24 AM, David Chelimsky &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890067&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dchelimsky@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890067&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dchelimsky@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons
&lt;br&gt;&amp;gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890067&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Hello Folks,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; This gist &lt;a href=&quot;http://gist.github.com/261791&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/261791&lt;/a&gt;&amp;nbsp;has an example user.rb,
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; user_spec.rb
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; At runtime, this snippet fails
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u = User.find(123)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; u.update_with_profile({...})
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The error occurred while evaluating nil.select):
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;   app/models/user.rb:6:in `moderator_fields'
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;   app/models/user.rb:118:in `update_with_profile'
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The spec passes all-green.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Could you tell me how this might be ?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The user in the spec comes from new_with_profile(), which sets instance
&lt;br&gt;&amp;gt;&amp;gt; variables on the User class.
&lt;br&gt;&amp;gt;&amp;gt; The user in the console comes from find(), and those ivars are not yet
&lt;br&gt;&amp;gt;&amp;gt; set.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Also - @params in the User class (in the class methods) is not the same
&lt;br&gt;&amp;gt; @params in the User instances (in update_with_profile).
&lt;br&gt;&amp;gt; HTH,
&lt;br&gt;&amp;gt; David
&lt;/div&gt;&lt;br&gt;&lt;br&gt;Also counting on class variables to retain state in Rails is a recipe
&lt;br&gt;for disaster.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Rick DeNatale
&lt;br&gt;&lt;br&gt;Blog: &lt;a href=&quot;http://talklikeaduck.denhaven2.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://talklikeaduck.denhaven2.com/&lt;/a&gt;&lt;br&gt;Twitter: &lt;a href=&quot;http://twitter.com/RickDeNatale&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://twitter.com/RickDeNatale&lt;/a&gt;&lt;br&gt;WWR: &lt;a href=&quot;http://www.workingwithrails.com/person/9021-rick-denatale&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.workingwithrails.com/person/9021-rick-denatale&lt;/a&gt;&lt;br&gt;LinkedIn: &lt;a href=&quot;http://www.linkedin.com/in/rickdenatale&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/in/rickdenatale&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26890067&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/class-variables-different-between-spec-and-runtime--tp26889846p26890067.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26889973</id>
	<title>Re: class variables different between spec and runtime?</title>
	<published>2009-12-22T07:24:33Z</published>
	<updated>2009-12-22T07:24:33Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Dec 22, 2009 at 9:22 AM, David Chelimsky &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889973&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dchelimsky@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div class=&quot;im&quot;&gt;On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889973&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex&quot;&gt;
Hello Folks,&lt;br&gt;&lt;br&gt;This gist &lt;a href=&quot;http://gist.github.com/261791&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/261791&lt;/a&gt; has an example user.rb, user_spec.rb&lt;br&gt;At runtime, this snippet fails&lt;br&gt;&lt;br&gt;u = User.find(123)&lt;br&gt;
u.update_with_profile({...})&lt;br&gt;

The error occurred while evaluating nil.select):&lt;br&gt;  app/models/user.rb:6:in `moderator_fields&amp;#39;&lt;br&gt;  app/models/user.rb:118:in `update_with_profile&amp;#39;&lt;br&gt;&lt;br&gt;The spec passes all-green.&lt;br&gt;&lt;br&gt;Could you tell me how this might be ?&lt;br&gt;

&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;The user in the spec comes from new_with_profile(), which sets instance variables on the User class.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The user in the console comes from find(), and those ivars are not yet set.&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Also - @params in the User class (in the class methods) is not the same @params in the User instances (in update_with_profile).&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;HTH,&lt;br&gt;David&lt;/div&gt;&lt;div&gt; &lt;/div&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;div class=&quot;gmail_quote&quot;&gt;
&lt;div&gt; &lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex&quot;&gt;&lt;div class=&quot;im&quot;&gt;
&lt;br&gt;Thanks,&lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;br clear=&quot;all&quot;&gt;Peter Fitzgibbons&lt;br&gt;(847) 687-7646&lt;br&gt;Email: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889973&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;IM GTalk: peter.fitzgibbons&lt;br&gt;

IM AOL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889973&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;

&lt;/font&gt;&lt;br&gt;&lt;/div&gt;_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889973&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889973&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/class-variables-different-between-spec-and-runtime--tp26889846p26889973.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26889959</id>
	<title>Re: class variables different between spec and runtime?</title>
	<published>2009-12-22T07:22:15Z</published>
	<updated>2009-12-22T07:22:15Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Dec 22, 2009 at 9:14 AM, Peter Fitzgibbons &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889959&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
Hello Folks,&lt;br&gt;&lt;br&gt;This gist &lt;a href=&quot;http://gist.github.com/261791&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/261791&lt;/a&gt; has an example user.rb, user_spec.rb&lt;br&gt;At runtime, this snippet fails&lt;br&gt;&lt;br&gt;u = User.find(123)&lt;br&gt;u.update_with_profile({...})&lt;br&gt;

The error occurred while evaluating nil.select):&lt;br&gt;  app/models/user.rb:6:in `moderator_fields&amp;#39;&lt;br&gt;  app/models/user.rb:118:in `update_with_profile&amp;#39;&lt;br&gt;&lt;br&gt;The spec passes all-green.&lt;br&gt;&lt;br&gt;Could you tell me how this might be ?&lt;br&gt;
&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The user in the spec comes from new_with_profile(), which sets instance variables on the User class.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The user in the console comes from find(), and those ivars are not yet set.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;br&gt;Thanks,&lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;br clear=&quot;all&quot;&gt;Peter Fitzgibbons&lt;br&gt;(847) 687-7646&lt;br&gt;Email: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889959&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;IM GTalk: peter.fitzgibbons&lt;br&gt;
IM AOL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889959&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;

&lt;/font&gt;&lt;br&gt;_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889959&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889959&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/class-variables-different-between-spec-and-runtime--tp26889846p26889959.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26889846</id>
	<title>class variables different between spec and runtime?</title>
	<published>2009-12-22T07:14:28Z</published>
	<updated>2009-12-22T07:14:28Z</updated>
	<author>
		<name>Peter Fitzgibbons</name>
	</author>
	<content type="html">Hello Folks,&lt;br&gt;&lt;br&gt;This gist &lt;a href=&quot;http://gist.github.com/261791&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/261791&lt;/a&gt; has an example user.rb, user_spec.rb&lt;br&gt;At runtime, this snippet fails&lt;br&gt;&lt;br&gt;u = User.find(123)&lt;br&gt;u.update_with_profile({...})&lt;br&gt;
The error occurred while evaluating nil.select):&lt;br&gt;  app/models/user.rb:6:in `moderator_fields&amp;#39;&lt;br&gt;  app/models/user.rb:118:in `update_with_profile&amp;#39;&lt;br&gt;&lt;br&gt;The spec passes all-green.&lt;br&gt;&lt;br&gt;Could you tell me how this might be ?&lt;br&gt;
&lt;br&gt;Thanks,&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;Peter Fitzgibbons&lt;br&gt;(847) 687-7646&lt;br&gt;Email: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889846&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;IM GTalk: peter.fitzgibbons&lt;br&gt;IM AOL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889846&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;peter.fitzgibbons@...&lt;/a&gt;&lt;br&gt;

&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889846&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/class-variables-different-between-spec-and-runtime--tp26889846p26889846.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26889278</id>
	<title>Re: spec with user culture</title>
	<published>2009-12-22T06:33:32Z</published>
	<updated>2009-12-22T06:33:32Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Tue, Dec 22, 2009 at 8:25 AM, Gnagno Gnagno &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889278&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;Tom Stuart wrote:&lt;br&gt;
&amp;gt; How does the application detect the user&amp;#39;s &amp;quot;culture&amp;quot;?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Cheers,&lt;br&gt;
&amp;gt; -Tom&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;Thanks for your reply Tom,&lt;br&gt;
&lt;br&gt;
in my home controller I have a line like this for each language:&lt;br&gt;
redirect_to localized_home_page_path :culture =&amp;gt; &amp;#39;es&amp;#39; and return if&lt;br&gt;
request.env[&amp;#39;HTTP_ACCEPT_LANGUAGE&amp;#39;].include? &amp;#39;es-ES&amp;#39;&lt;br&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;You can set that explicitly in the example:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; &quot;&gt;&lt;br&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; &quot;&gt;it &amp;quot;should redirect to spanish home page&amp;quot; do&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; font-family: arial; font-size: small; &quot;&gt;  request.env[&amp;#39;HTTP_ACCEPT_LANGUAGE&amp;#39;] = &amp;#39;es-ES&amp;#39;&lt;/span&gt;&lt;br&gt;
  get &amp;#39;index&amp;#39;&lt;br&gt;  response.should redirect_to(spanish_home_page)&lt;br&gt;end&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; &quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; &quot;&gt;HTH,&lt;br&gt;David&lt;/span&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;

&lt;br&gt;
as I said before I am just &amp;#39;experimenting and playing&amp;#39; so any suggestion&lt;br&gt;
is accepted :)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
maybe I should access to the request object from my spec code?&lt;br&gt;
&lt;div class=&quot;im&quot;&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
--&lt;br&gt;
Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.&lt;br&gt;
_______________________________________________&lt;br&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889278&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889278&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/spec-with-user-culture-tp26886928p26889278.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26889156</id>
	<title>Re: spec with user culture</title>
	<published>2009-12-22T06:25:12Z</published>
	<updated>2009-12-22T06:25:12Z</updated>
	<author>
		<name>Marnen Laibow-Koser-2</name>
	</author>
	<content type="html">Tom Stuart wrote:
&lt;br&gt;&amp;gt; How does the application detect the user's &amp;quot;culture&amp;quot;?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Cheers,
&lt;br&gt;&amp;gt; -Tom
&lt;br&gt;&lt;br&gt;Thanks for your reply Tom,
&lt;br&gt;&lt;br&gt;in my home controller I have a line like this for each language:
&lt;br&gt;redirect_to localized_home_page_path :culture =&amp;gt; 'es' and return if 
&lt;br&gt;request.env['HTTP_ACCEPT_LANGUAGE'].include? 'es-ES'
&lt;br&gt;&lt;br&gt;as I said before I am just 'experimenting and playing' so any suggestion 
&lt;br&gt;is accepted :)
&lt;br&gt;&lt;br&gt;&lt;br&gt;maybe I should access to the request object from my spec code?
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26889156&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/spec-with-user-culture-tp26886928p26889156.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26887099</id>
	<title>Re: spec with user culture</title>
	<published>2009-12-22T03:41:01Z</published>
	<updated>2009-12-22T03:41:01Z</updated>
	<author>
		<name>Tom Stuart</name>
	</author>
	<content type="html">On 22 Dec 2009, at 11:26, Gnagno Gnagno wrote:
&lt;br&gt;&amp;gt; it &amp;quot;should redirect to spanish home page&amp;quot; do
&lt;br&gt;&amp;gt; &amp;nbsp;get 'index'
&lt;br&gt;&amp;gt; &amp;nbsp;#don't know how to say the culture is spanish
&lt;br&gt;&amp;gt; &amp;nbsp;response.should redirect_to(spanish_home_page)
&lt;br&gt;&amp;gt; end
&lt;br&gt;&lt;br&gt;How does the application detect the user's &amp;quot;culture&amp;quot;?
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;-Tom
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26887099&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/spec-with-user-culture-tp26886928p26887099.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26886928</id>
	<title>spec with user culture</title>
	<published>2009-12-22T03:26:23Z</published>
	<updated>2009-12-22T03:26:23Z</updated>
	<author>
		<name>Marnen Laibow-Koser-2</name>
	</author>
	<content type="html">Hello all,
&lt;br&gt;I am making my first experiments with rspec, I wanted to do something
&lt;br&gt;like this:
&lt;br&gt;&lt;br&gt;when a user visit the home page of my site he will be redirected
&lt;br&gt;depending on his culture, so if his culture is english he will be
&lt;br&gt;redirected to myapp/en if he is italian to myapp/it and so on....
&lt;br&gt;&lt;br&gt;how can I say this with rspec?
&lt;br&gt;I was trying something like:
&lt;br&gt;&lt;br&gt;it &amp;quot;should redirect to spanish home page&amp;quot; do
&lt;br&gt;&amp;nbsp; get 'index'
&lt;br&gt;&amp;nbsp; #don't know how to say the culture is spanish
&lt;br&gt;&amp;nbsp; response.should redirect_to(spanish_home_page)
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;any help?
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;Gnagno
&lt;br&gt;-- 
&lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26886928&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/spec-with-user-culture-tp26886928p26886928.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26866175</id>
	<title>Re: no should raise_exception</title>
	<published>2009-12-20T10:51:23Z</published>
	<updated>2009-12-20T10:51:23Z</updated>
	<author>
		<name>Ashley Moran-4</name>
	</author>
	<content type="html">&lt;br&gt;On Dec 20, 2009, at 6:07 am, Elliot Winkler wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; raise_error already catches any type of exception, error or not:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; class BlahException &amp;lt; Exception; end
&lt;br&gt;&amp;gt; &amp;nbsp; class BlahError &amp;lt; StandardError; end
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp;lambda { raise BlahException }.should raise_error(BlahException)
&lt;br&gt;&amp;gt; &amp;nbsp;lambda { raise BlahError }.should raise_error(BlahError)
&lt;br&gt;&amp;gt; &amp;nbsp;lambda { raise &amp;quot;blah&amp;quot; }.should raise_error(RuntimeError, &amp;quot;blah&amp;quot;)
&lt;br&gt;&lt;br&gt;Although it would be unusual to catch non-Error Exceptions in most cases? &amp;nbsp;Most indicate unrecoverable failure; only the SignalException looks like something you might want to catch - I don't know, though. &amp;nbsp;I assume you'd normally register a handler for that.
&lt;br&gt;&lt;br&gt;Ashley
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;a href=&quot;http://www.patchspace.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.patchspace.co.uk/&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.linkedin.com/in/ashleymoran&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/in/ashleymoran&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26866175&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/no-should-raise_exception-tp26861103p26866175.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26861289</id>
	<title>Re: no should raise_exception</title>
	<published>2009-12-19T22:07:14Z</published>
	<updated>2009-12-19T22:07:14Z</updated>
	<author>
		<name>Elliot Winkler</name>
	</author>
	<content type="html">raise_error already catches any type of exception, error or not:
&lt;br&gt;&lt;br&gt;  class BlahException &amp;lt; Exception; end
&lt;br&gt;  class BlahError &amp;lt; StandardError; end
&lt;br&gt;&lt;br&gt;&amp;nbsp; lambda { raise BlahException }.should raise_error(BlahException)
&lt;br&gt;&amp;nbsp; lambda { raise BlahError }.should raise_error(BlahError)
&lt;br&gt;&amp;nbsp; lambda { raise &amp;quot;blah&amp;quot; }.should raise_error(RuntimeError, &amp;quot;blah&amp;quot;)
&lt;br&gt;&lt;br&gt;-- Elliot
&lt;br&gt;&lt;br&gt;On Sat, Dec 19, 2009 at 11:12 PM, rogerdpack &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26861289&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rogerpack2005@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I know there's a raise_error
&lt;br&gt;&amp;gt; however...exceptions are not always errors, so I had expected a
&lt;br&gt;&amp;gt; raise_exception matcher...would this be a reasonable addition (I'd be
&lt;br&gt;&amp;gt; happy to do it).
&lt;br&gt;&amp;gt; Thanks.
&lt;br&gt;&amp;gt; -r
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; rspec-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26861289&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;/div&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26861289&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/no-should-raise_exception-tp26861103p26861289.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26861103</id>
	<title>no should raise_exception</title>
	<published>2009-12-19T21:12:48Z</published>
	<updated>2009-12-19T21:12:48Z</updated>
	<author>
		<name>rogerdpack</name>
	</author>
	<content type="html">I know there's a raise_error
&lt;br&gt;however...exceptions are not always errors, so I had expected a
&lt;br&gt;raise_exception matcher...would this be a reasonable addition (I'd be
&lt;br&gt;happy to do it).
&lt;br&gt;Thanks.
&lt;br&gt;-r
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26861103&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/no-should-raise_exception-tp26861103p26861103.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26860366</id>
	<title>Re: State-based expectations (as per jMock in GOOS)</title>
	<published>2009-12-19T17:54:05Z</published>
	<updated>2009-12-19T17:54:05Z</updated>
	<author>
		<name>Ashley Moran-4</name>
	</author>
	<content type="html">&lt;br&gt;On 18 Dec 2009, at 14:46, Tom Stuart wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Can you elaborate? From a position of no knowledge, the most obvious question to me is: why would I care about the state of O? Either the change in O's state is observable through its behaviour (in which case I specify that behaviour) or it's not (in which case I don't care).
&lt;br&gt;&lt;br&gt;&lt;br&gt;On further investigation (aka reading up to chapter 24) it's apparent that this state-based testing is effectively a flexible form of message expectation ordering. &amp;nbsp;What's clever is that it gives an intermediate level between no ordering and sequential ordering. &amp;nbsp;It's like ordering &amp;quot;sets&amp;quot; of expectations, at least that's how it appears to me at first glance.
&lt;br&gt;&lt;br&gt;Worth more investigation, I think...
&lt;br&gt;&lt;br&gt;Ashley
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;a href=&quot;http://www.patchspace.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.patchspace.co.uk/&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.linkedin.com/in/ashleymoran&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/in/ashleymoran&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26860366&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/State-based-expectations-%28as-per-jMock-in-GOOS%29-tp26844424p26860366.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26844890</id>
	<title>Re: State-based expectations (as per jMock in GOOS)</title>
	<published>2009-12-18T07:15:59Z</published>
	<updated>2009-12-18T07:15:59Z</updated>
	<author>
		<name>Ashley Moran-4</name>
	</author>
	<content type="html">&lt;br&gt;On Dec 18, 2009, at 2:46 pm, Tom Stuart wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Can you elaborate? From a position of no knowledge, the most obvious question to me is: why would I care about the state of O? Either the change in O's state is observable through its behaviour (in which case I specify that behaviour) or it's not (in which case I don't care).
&lt;br&gt;&lt;br&gt;The example given is for an auction sniper (S). &amp;nbsp;So, 
&lt;br&gt;&lt;br&gt;&amp;nbsp; Given S has just notified one of its listeners that it's bidding
&lt;br&gt;&amp;nbsp; When S is informed that a bid has been made by a competitor
&lt;br&gt;&amp;nbsp; And the auction is closed
&lt;br&gt;&amp;nbsp; Then S should notify its listeners that it lost the auction
&lt;br&gt;&lt;br&gt;&amp;nbsp; Given S has just notified one of its listeners that it's bidding
&lt;br&gt;&amp;nbsp; When S is informed that its bid is highest
&lt;br&gt;&amp;nbsp; And the auction is closed
&lt;br&gt;&amp;nbsp; Then S should notify its listeners that it won the auction
&lt;br&gt;&lt;br&gt;The last one looks like the code below in Java[1], but note this is further on from the code in chapter 14.
&lt;br&gt;&lt;br&gt;Interestingly, writing it as GWT transforms the style of the expectations. &amp;nbsp;eg,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;quot;When S is informed that a bid has been made by a competitor&amp;quot;
&lt;br&gt;&lt;br&gt;replaces (something like)
&lt;br&gt;&lt;br&gt;&amp;nbsp; Allow S to notify its listeners that it's in the bidding state
&lt;br&gt;&lt;br&gt;Am I making sense? &amp;nbsp;Not sure if these examples capture the essense.
&lt;br&gt;&lt;br&gt;Ashley
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; @Test public void 
&lt;br&gt;&amp;nbsp; reportsWonIfAuctionClosesWhenWinning() { 
&lt;br&gt;&amp;nbsp; &amp;nbsp; allowingSniperBidding();
&lt;br&gt;&amp;nbsp; &amp;nbsp; allowingSniperWinning();
&lt;br&gt;&amp;nbsp; &amp;nbsp; ignoringAuction();
&lt;br&gt;&amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; context.checking(new Expectations() {{ 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; atLeast(1).of(sniperListener).sniperStateChanged(
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new SniperSnapshot(ITEM_ID, 135, 135, WON));
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; when(sniperState.is(&amp;quot;winning&amp;quot;));
&lt;br&gt;&amp;nbsp; &amp;nbsp; }}); 
&lt;br&gt;&amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; sniper.currentPrice(123, 12, PriceSource.FromOtherBidder);
&lt;br&gt;&amp;nbsp; &amp;nbsp; sniper.currentPrice(135, 45, PriceSource.FromSniper); 
&lt;br&gt;&amp;nbsp; &amp;nbsp; sniper.auctionClosed(); 
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;&amp;nbsp; private void allowingSniperBidding() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; allowSniperStateChange(BIDDING, &amp;quot;bidding&amp;quot;);
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; private void allowingSniperWinning() {
&lt;br&gt;&amp;nbsp; &amp;nbsp; allowSniperStateChange(WINNING, &amp;quot;winning&amp;quot;);
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; private void allowSniperStateChange(final SniperState newState, final String oldState) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; context.checking(new Expectations() {{ 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; allowing(sniperListener).sniperStateChanged(with(aSniperThatIs(newState))); then(sniperState.is(oldState));
&lt;br&gt;&amp;nbsp; &amp;nbsp; }});
&lt;br&gt;&amp;nbsp; }
&lt;br&gt;&lt;br&gt;[1] &lt;a href=&quot;http://github.com/sf105/goos-code/blob/master/test/unit/test/auctionsniper/AuctionSniperTest.java&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/sf105/goos-code/blob/master/test/unit/test/auctionsniper/AuctionSniperTest.java&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;a href=&quot;http://www.patchspace.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.patchspace.co.uk/&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.linkedin.com/in/ashleymoran&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/in/ashleymoran&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26844890&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/State-based-expectations-%28as-per-jMock-in-GOOS%29-tp26844424p26844890.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26844647</id>
	<title>Re: State-based expectations (as per jMock in GOOS)</title>
	<published>2009-12-18T06:46:50Z</published>
	<updated>2009-12-18T06:46:50Z</updated>
	<author>
		<name>Tom Stuart</name>
	</author>
	<content type="html">On 18 Dec 2009, at 14:35, Ashley Moran wrote:
&lt;br&gt;&amp;gt; The principle appears to be 
&lt;br&gt;&amp;gt; &amp;nbsp;object O has sent message M =&amp;gt; O is in state S
&lt;br&gt;&amp;gt; followed by
&lt;br&gt;&amp;gt; &amp;nbsp;O is in state S &amp;nbsp; &amp;nbsp; =&amp;gt; (expectation E met) passes spec
&lt;br&gt;&amp;gt; &amp;nbsp;O is not in state S =&amp;gt; (expectation E met) violates spec
&lt;br&gt;&lt;br&gt;Can you elaborate? From a position of no knowledge, the most obvious question to me is: why would I care about the state of O? Either the change in O's state is observable through its behaviour (in which case I specify that behaviour) or it's not (in which case I don't care).
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;-Tom
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26844647&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/State-based-expectations-%28as-per-jMock-in-GOOS%29-tp26844424p26844647.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26844424</id>
	<title>State-based expectations (as per jMock in GOOS)</title>
	<published>2009-12-18T06:35:55Z</published>
	<updated>2009-12-18T06:35:55Z</updated>
	<author>
		<name>Ashley Moran-4</name>
	</author>
	<content type="html">Hi all
&lt;br&gt;&lt;br&gt;I'm working my way through Growing Object-Oriented Software[1], currently at the start of chapter 15. &amp;nbsp;Chapter 14 introduces a concept I haven't seen before, state-based expectations based on sent messages.
&lt;br&gt;&lt;br&gt;The principle appears to be 
&lt;br&gt;&lt;br&gt;&amp;nbsp; object O has sent message M =&amp;gt; O is in state S
&lt;br&gt;&lt;br&gt;followed by
&lt;br&gt;&lt;br&gt;&amp;nbsp; O is in state S &amp;nbsp; &amp;nbsp; =&amp;gt; (expectation E met) passes spec
&lt;br&gt;&amp;nbsp; O is not in state S =&amp;gt; (expectation E met) violates spec
&lt;br&gt;&lt;br&gt;Has anyone tried this with RSpec (mocks) yet? &amp;nbsp;Just wondered if it was doable with the current syntax support or would need an extension.
&lt;br&gt;&lt;br&gt;I thought I'd fire this off now to get ideas, as I won't be coding using this technique until I've finished the book (a week at least, I imagine).
&lt;br&gt;&lt;br&gt;Cheers
&lt;br&gt;Ashley
&lt;br&gt;&lt;br&gt;[1] &lt;a href=&quot;http://www.amazon.co.uk/gp/product/0321503627/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.co.uk/gp/product/0321503627/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;a href=&quot;http://www.patchspace.co.uk/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.patchspace.co.uk/&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.linkedin.com/in/ashleymoran&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/in/ashleymoran&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26844424&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/State-based-expectations-%28as-per-jMock-in-GOOS%29-tp26844424p26844424.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26815276</id>
	<title>Re: spec'ing controllers</title>
	<published>2009-12-16T09:33:56Z</published>
	<updated>2009-12-16T09:33:56Z</updated>
	<author>
		<name>Pat Maddox-3</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;a href=&quot;http://archive.patmaddox.com/blog/2009/1/15/how-i-test-controllers-2009-remix&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://archive.patmaddox.com/blog/2009/1/15/how-i-test-controllers-2009-remix&lt;/a&gt; is my take on things. &amp;nbsp;Due for an update though looks like :)&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div&gt;&lt;div&gt;On Dec 16, 2009, at 8:56 AM, Stefan Kanev wrote:&lt;/div&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;blockquote type=&quot;cite&quot;&gt;Hey guys.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I switched completely to RSpec and Cucumber this spring and I am really happy with. While I think I've gotten quite good with it, I'm not sure I understand the value of spec'ing controllers (in Rails). I would appreciate if you can give me some suggestions. Let me elaborate:&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The RSpec book suggests mocking models and not integrating vies controller specs. Following that, I usually end up with something like this:&amp;nbsp;&lt;a href=&quot;http://gist.github.com/257946&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/257946&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I see a few benefits:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;It helps keeping the controllers simple. For example, while writing that spec I discovered that Topic should have #update_topic_hits (as opposed to inlining it there). That improved the design.&lt;/li&gt;
&lt;li&gt;When mocking gets tricky, I treat this as a code smell and start refactoring. Usually it works out well.&lt;/li&gt;&lt;li&gt;Specs are faster. Remembering how much time it took to run the functional tests on an old project, I can really appreciate that.&lt;/li&gt;
&lt;li&gt;Small changes in models (or views) don't result in broken controller specs. It took some time, but I can see it now.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;However, I still don't feel too confident about the way I'm doing it. Some of my worries:&lt;/div&gt;
&lt;div&gt;&lt;ul&gt;&lt;li&gt;It feels like lots and lots of code. I'm normally at 2:1 test:code, but it feels I'm overdoing it. *feels* is the key word here -- I might be worrying too much.&lt;/li&gt;&lt;li&gt;I have a similar spec for each RESTful controller. Looks like duplication, but I'm not sure what to do about it&lt;/li&gt;
&lt;li&gt;Often the specs are passing when the code is broken (due to the mocks). While Cucumber catches those errors for me, I'm not sure if they shouldn't be in the specs in some way.&lt;/li&gt;&lt;li&gt;It's a lot of effort. Eventually ones gets used to it, but I can't decide whether it pays of or not.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Can you validate (or invalidate) my reasoning? It will be very nice to hear a comment from more experienced rspec users. Comments on the the spec I posted would be appreciated too, of course.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;Thanks very much,&lt;/div&gt;&lt;div&gt;Stefan&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
_______________________________________________&lt;br&gt;rspec-users mailing list&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815276&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815276&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/spec%27ing-controllers-tp26814529p26815276.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26815164</id>
	<title>Re: spec'ing controllers</title>
	<published>2009-12-16T09:31:04Z</published>
	<updated>2009-12-16T09:31:04Z</updated>
	<author>
		<name>Matt Wynne</name>
	</author>
	<content type="html">&lt;br&gt;On 16 Dec 2009, at 16:56, Stefan Kanev wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hey guys.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I switched completely to RSpec and Cucumber this spring and I am &amp;nbsp;
&lt;br&gt;&amp;gt; really happy with. While I think I've gotten quite good with it, I'm &amp;nbsp;
&lt;br&gt;&amp;gt; not sure I understand the value of spec'ing controllers (in Rails). &amp;nbsp;
&lt;br&gt;&amp;gt; I would appreciate if you can give me some suggestions. Let me &amp;nbsp;
&lt;br&gt;&amp;gt; elaborate:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The RSpec book suggests mocking models and not integrating vies &amp;nbsp;
&lt;br&gt;&amp;gt; controller specs. Following that, I usually end up with something &amp;nbsp;
&lt;br&gt;&amp;gt; like this: &lt;a href=&quot;http://gist.github.com/257946&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/257946&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I see a few benefits:
&lt;br&gt;&amp;gt; 	• It helps keeping the controllers simple. For example, while &amp;nbsp;
&lt;br&gt;&amp;gt; writing that spec I discovered that Topic should have &amp;nbsp;
&lt;br&gt;&amp;gt; #update_topic_hits (as opposed to inlining it there). That improved &amp;nbsp;
&lt;br&gt;&amp;gt; the design.
&lt;br&gt;&amp;gt; 	• When mocking gets tricky, I treat this as a code smell and start &amp;nbsp;
&lt;br&gt;&amp;gt; refactoring. Usually it works out well.
&lt;br&gt;&amp;gt; 	• Specs are faster. Remembering how much time it took to run the &amp;nbsp;
&lt;br&gt;&amp;gt; functional tests on an old project, I can really appreciate that.
&lt;br&gt;&amp;gt; 	• Small changes in models (or views) don't result in broken &amp;nbsp;
&lt;br&gt;&amp;gt; controller specs. It took some time, but I can see it now.
&lt;br&gt;&amp;gt; However, I still don't feel too confident about the way I'm doing &amp;nbsp;
&lt;br&gt;&amp;gt; it. Some of my worries:
&lt;br&gt;&amp;gt; 	• It feels like lots and lots of code. I'm normally at 2:1 &amp;nbsp;
&lt;br&gt;&amp;gt; test:code, but it feels I'm overdoing it. *feels* is the key word &amp;nbsp;
&lt;br&gt;&amp;gt; here -- I might be worrying too much.
&lt;br&gt;&amp;gt; 	• I have a similar spec for each RESTful controller. Looks like &amp;nbsp;
&lt;br&gt;&amp;gt; duplication, but I'm not sure what to do about it
&lt;br&gt;&amp;gt; 	• Often the specs are passing when the code is broken (due to the &amp;nbsp;
&lt;br&gt;&amp;gt; mocks). While Cucumber catches those errors for me, I'm not sure if &amp;nbsp;
&lt;br&gt;&amp;gt; they shouldn't be in the specs in some way.
&lt;br&gt;&amp;gt; 	• It's a lot of effort. Eventually ones gets used to it, but I &amp;nbsp;
&lt;br&gt;&amp;gt; can't decide whether it pays of or not.
&lt;br&gt;&amp;gt; Can you validate (or invalidate) my reasoning? It will be very nice &amp;nbsp;
&lt;br&gt;&amp;gt; to hear a comment from more experienced rspec users. Comments on the &amp;nbsp;
&lt;br&gt;&amp;gt; the spec I posted would be appreciated too, of course.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks very much,
&lt;br&gt;&amp;gt; Stefan
&lt;/div&gt;&lt;br&gt;Sounds like you've got it just about right to me :)
&lt;br&gt;&lt;br&gt;I think the excess overhead thing will pass. Partly because you'll get &amp;nbsp;
&lt;br&gt;faster at it, but also partly as your design skill improves (guided by &amp;nbsp;
&lt;br&gt;mocks) you'll feel less need to drive out every single change with a &amp;nbsp;
&lt;br&gt;unit test, and rely a little more on Cucumber. Your observation about &amp;nbsp;
&lt;br&gt;specs passing when mocks are wrong is a common one, and one I remember &amp;nbsp;
&lt;br&gt;struggling with when I first learned TDD, but again as you learn to &amp;nbsp;
&lt;br&gt;trust Cucumber you'll find that this is OK.
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Matt
&lt;br&gt;&lt;br&gt;+447974 430184
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815164&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;matt@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://mattwynne.net&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mattwynne.net&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815164&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/spec%27ing-controllers-tp26814529p26815164.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26814529</id>
	<title>spec'ing controllers</title>
	<published>2009-12-16T08:56:46Z</published>
	<updated>2009-12-16T08:56:46Z</updated>
	<author>
		<name>Stefan Kanev</name>
	</author>
	<content type="html">Hey guys.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I switched completely to RSpec and Cucumber this spring and I am really happy with. While I think I&amp;#39;ve gotten quite good with it, I&amp;#39;m not sure I understand the value of spec&amp;#39;ing controllers (in Rails). I would appreciate if you can give me some suggestions. Let me elaborate:&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The RSpec book suggests mocking models and not integrating vies controller specs. Following that, I usually end up with something like this: &lt;a href=&quot;http://gist.github.com/257946&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gist.github.com/257946&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I see a few benefits:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;It helps keeping the controllers simple. For example, while writing that spec I discovered that Topic should have #update_topic_hits (as opposed to inlining it there). That improved the design.&lt;/li&gt;
&lt;li&gt;When mocking gets tricky, I treat this as a code smell and start refactoring. Usually it works out well.&lt;/li&gt;&lt;li&gt;Specs are faster. Remembering how much time it took to run the functional tests on an old project, I can really appreciate that.&lt;/li&gt;
&lt;li&gt;Small changes in models (or views) don&amp;#39;t result in broken controller specs. It took some time, but I can see it now.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;However, I still don&amp;#39;t feel too confident about the way I&amp;#39;m doing it. Some of my worries:&lt;/div&gt;
&lt;div&gt;&lt;ul&gt;&lt;li&gt;It feels like lots and lots of code. I&amp;#39;m normally at 2:1 test:code, but it feels I&amp;#39;m overdoing it. *feels* is the key word here -- I might be worrying too much.&lt;/li&gt;&lt;li&gt;I have a similar spec for each RESTful controller. Looks like duplication, but I&amp;#39;m not sure what to do about it&lt;/li&gt;
&lt;li&gt;Often the specs are passing when the code is broken (due to the mocks). While Cucumber catches those errors for me, I&amp;#39;m not sure if they shouldn&amp;#39;t be in the specs in some way.&lt;/li&gt;&lt;li&gt;It&amp;#39;s a lot of effort. Eventually ones gets used to it, but I can&amp;#39;t decide whether it pays of or not.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Can you validate (or invalidate) my reasoning? It will be very nice to hear a comment from more experienced rspec users. Comments on the the spec I posted would be appreciated too, of course.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;Thanks very much,&lt;/div&gt;&lt;div&gt;Stefan&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26814529&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/spec%27ing-controllers-tp26814529p26814529.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26798326</id>
	<title>cleanup pendings?</title>
	<published>2009-12-15T09:05:43Z</published>
	<updated>2009-12-15T09:05:43Z</updated>
	<author>
		<name>rogerdpack</name>
	</author>
	<content type="html">Currently with pending...
&lt;br&gt;&lt;br&gt;&lt;br&gt;it &amp;quot;should do something&amp;quot;;
&lt;br&gt;&lt;br&gt;or
&lt;br&gt;&lt;br&gt;it &amp;quot;should do something&amp;quot; do
&lt;br&gt;&amp;nbsp; pending &amp;quot;some work&amp;quot;
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;&lt;br&gt;I get this type of output:
&lt;br&gt;&lt;br&gt;Pending:
&lt;br&gt;&lt;br&gt;After should immediately return if the other process doesn't exist
&lt;br&gt;(Not Yet Implemented)
&lt;br&gt;C:/dev/ruby/wait_for/test/spec.after.rb:5:in `block in &amp;lt;top (required)
&lt;br&gt;&amp;gt;'
&lt;br&gt;&lt;br&gt;that part in block in &amp;lt;top (required)&amp;gt; is a bit confusing to me.
&lt;br&gt;Anyway to get rid of that, or what is going on?
&lt;br&gt;&lt;br&gt;Thanks!
&lt;br&gt;-r
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26798326&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/cleanup-pendings--tp26798326p26798326.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26789891</id>
	<title>Re: &quot;have&quot; matcher special case for owned collection with 1 item</title>
	<published>2009-12-14T21:59:55Z</published>
	<updated>2009-12-14T21:59:55Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Mon, Dec 14, 2009 at 3:57 PM, DeNigris Sean &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26789891&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sean@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; If I'm reading the docs right, the current implementation would be:  my_workspace.should have(1).documents
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Would it be hard to have it be:  my_workspace.should have(1).document
&lt;br&gt;&amp;gt;                                                                                                                  ^
&lt;br&gt;&amp;gt;                                                                                                              (no s)
&lt;br&gt;&lt;br&gt;Should be pretty simple. Why don't you file a feature request at
&lt;br&gt;&lt;a href=&quot;http://rspec.lighthouseapp.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rspec.lighthouseapp.com&lt;/a&gt;? If you submit a patch w/ specs it'll
&lt;br&gt;likely get in sooner than later.
&lt;br&gt;&lt;br&gt;&amp;gt; Sean DeNigris
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26789891&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sean@...&lt;/a&gt;
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26789891&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/%22have%22-matcher-special-case-for-owned-collection-with-1-item-tp26789822p26789891.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26789822</id>
	<title>&quot;have&quot; matcher special case for owned collection with 1 item</title>
	<published>2009-12-14T13:57:36Z</published>
	<updated>2009-12-14T13:57:36Z</updated>
	<author>
		<name>DeNigris Sean</name>
	</author>
	<content type="html">If I'm reading the docs right, the current implementation would be: &amp;nbsp;my_workspace.should have(1).documents
&lt;br&gt;&lt;br&gt;Would it be hard to have it be: &amp;nbsp;my_workspace.should have(1).document
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ^
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (no s)
&lt;br&gt;Sean DeNigris
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26789822&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sean@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26789822&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/%22have%22-matcher-special-case-for-owned-collection-with-1-item-tp26789822p26789822.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26785670</id>
	<title>Re: RSPEC and RoR undefined method for hash when running model tests</title>
	<published>2009-12-14T13:50:04Z</published>
	<updated>2009-12-14T13:50:04Z</updated>
	<author>
		<name>Matt Riches</name>
	</author>
	<content type="html">&lt;div&gt;Yup, I did.&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks all. (unless anyone has any comments on the constants question I just asked in a previous post?)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regards&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Matt&lt;/div&gt;&lt;br&gt;
&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/14 Tom Stuart &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785670&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tom@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;div class=&quot;im&quot;&gt;On 14 Dec 2009, at 21:28, Matt Riches wrote:&lt;br&gt;
&amp;gt; describe Address do&lt;br&gt;
&amp;gt;   #Test Fixture - Before Each test Create a Standard Bread with the following attributes and properties&lt;br&gt;
&amp;gt;   before(:each) do&lt;br&gt;
&amp;gt;     @address = {&lt;br&gt;
&amp;gt;       :business_name =&amp;gt; &amp;#39;business&amp;#39;, :first_line =&amp;gt; &amp;#39;10, This Street&amp;#39;, :second_line=&amp;gt; &amp;#39;erewhon&amp;#39;, :town=&amp;gt; &amp;#39;town&amp;#39;, :county=&amp;gt;&amp;#39;county&amp;#39;,&lt;br&gt;
&amp;gt;       :postcode =&amp;gt;&amp;#39;AB12 3CD&amp;#39;, :user_id =&amp;gt; 1, :lat=&amp;gt;1.01, :lng=&amp;gt;2.02, :status=&amp;gt;Address::JUST_REGISTERED, :route_id=&amp;gt;1&lt;br&gt;
&amp;gt;     }&lt;br&gt;
&amp;gt;   end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;   it &amp;quot;should have a status of deleted after reset&amp;quot; do&lt;br&gt;
&amp;gt;     @address.reset&lt;br&gt;
&amp;gt;     @address.status.should == :Address::DELETED&lt;br&gt;
&amp;gt;   end&lt;br&gt;
&amp;gt; end&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;The problem is that you&amp;#39;re setting @address to a hash, not an instance of Address. Did you mean @address = Address.new :business_name =&amp;gt; ...?&lt;br&gt;
&lt;div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
Cheers,&lt;br&gt;
-Tom&lt;br&gt;
_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785670&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785670&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/RSPEC-and-RoR-undefined-method-for-hash-when-running-model-tests-tp26784481p26785670.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26785576</id>
	<title>Re: RSPEC and RoR undefined method for hash when running model tests</title>
	<published>2009-12-14T13:48:49Z</published>
	<updated>2009-12-14T13:48:49Z</updated>
	<author>
		<name>Matt Riches</name>
	</author>
	<content type="html">&lt;div&gt;I am still learning, and its been along and frustrating day, but thanks !&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Sometimes a fresh (more experienced pair of eyes) can spot the blindingly obvious :)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;ok, one more quick question, and its slightly more general and then Im going home for the day.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;When I run my tests now I get a series of lines &lt;/div&gt;&lt;div&gt;warning: already initialised constant JUST_REGISTERED&lt;/div&gt;&lt;div&gt;warning: already initialised constant DELETED &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;etc.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;as its only a warning I am not too bothered, but ideally I&amp;#39;d like to stop it if I can. Is this an artefact of me creating constants in the class, then it being called before(:each) ? Is there some way of supressing the warnings, or making the constants only get assigned once? (Maybe another class that just implements the constants?)&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regards&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Matt&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/14 Vishu Ramanathan &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785576&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;vishu@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;span style=&quot;font-family:arial, sans-serif;font-size:13px;border-collapse:collapse&quot;&gt;&lt;div&gt;This should have been the giveaway &lt;/div&gt;
&lt;div class=&quot;im&quot;&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex&quot;&gt;

undefined method &amp;#39;status&amp;#39; for #&amp;lt;&lt;b&gt;Hash&lt;/b&gt;...&amp;gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;In your before you&amp;#39;re assigning @address to the parameters, not to a new address&lt;/div&gt;&lt;div&gt;@address = {:foo =&amp;gt; &amp;#39;bar&amp;#39;}&lt;/div&gt;

&lt;div&gt;instead of&lt;/div&gt;&lt;div&gt;@address = Address.new({:foo =&amp;gt; &amp;#39;bar&amp;#39;})&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;-V&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/span&gt;&lt;div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Dec 14, 2009 at 3:28 PM, Matt Riches &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785576&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mattriches@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;

&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex&quot;&gt;Fair point, thought you could also assume that the omissions are down to my newness at RSpec and RoR :-)&lt;br&gt;&lt;br&gt;The whole of the code is rather large, I am being asked to retrofit rspec onto the code base as things are changed, so I am only showing what I think are the relevent things..&lt;br&gt;



&lt;br&gt;&lt;h2&gt;Code Section &lt;/h2&gt;




	
	&lt;div&gt;
		&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
		&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
				
				&lt;pre&gt;1&lt;br&gt;2&lt;br&gt;3&lt;br&gt;4&lt;br&gt;5&lt;br&gt;6&lt;br&gt;7&lt;br&gt;8&lt;br&gt;9&lt;br&gt;10&lt;br&gt;11&lt;br&gt;12&lt;br&gt;13&lt;br&gt;14&lt;br&gt;15&lt;br&gt;16&lt;br&gt;17&lt;br&gt;18&lt;br&gt;19&lt;br&gt;20&lt;br&gt;21&lt;br&gt;22&lt;br&gt;23&lt;br&gt;24&lt;br&gt;25&lt;br&gt;26&lt;br&gt;27&lt;br&gt;28&lt;br&gt;29&lt;br&gt;30&lt;br&gt;31&lt;br&gt;32&lt;br&gt;
33&lt;br&gt;34&lt;br&gt;&lt;/pre&gt;			&lt;/td&gt;&lt;td&gt;
		&lt;pre&gt;&lt;pre&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;class&lt;/span&gt; &lt;span&gt;Address&lt;span&gt; &amp;lt; ActiveRecord::Base&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;span&gt;  #Status Codes as Constants&lt;/span&gt;&lt;br&gt;  &lt;span&gt;JUST_REGISTERED&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;DELETED&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;DECLINED&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;2&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;APPROVED&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;3&lt;/span&gt;&lt;br&gt;
&lt;br&gt;&lt;span&gt;&lt;span&gt;def&lt;/span&gt; &lt;span&gt;status&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;DELETED&lt;/span&gt;&lt;br&gt;&lt;/span&gt;&lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;  &lt;span&gt;&lt;span&gt;def&lt;/span&gt; &lt;span&gt;reset&lt;/span&gt;&lt;/span&gt;    &lt;br&gt;
&lt;span&gt;    #We don&amp;#39;t actually delete the record&lt;/span&gt;&lt;br&gt;&lt;span&gt;    #Instead a status field is set&lt;/span&gt;&lt;br&gt;
&lt;span&gt;    #And all the data is blanked for data protection reasons&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span&gt;self&lt;/span&gt;.status &lt;span&gt;=&lt;/span&gt; &lt;span&gt;DELETED&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.business_name &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.first_line &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.second_line &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.town &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.county &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.postcode &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
&lt;span&gt;    #MR - added in the following fields&lt;/span&gt;&lt;br&gt;    &lt;span&gt;self&lt;/span&gt;.lat &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.lng &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.route_id &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.save&lt;br&gt;  &lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;span&gt;#.. other code elided&lt;/span&gt;&lt;br&gt;
&lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/pre&gt;		&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
	
	&lt;/div&gt;


&lt;hr&gt;
&lt;h2&gt;RSpec &lt;/h2&gt;




	
	
		
		
			&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
				
				&lt;pre&gt;1&lt;br&gt;2&lt;br&gt;3&lt;br&gt;4&lt;br&gt;5&lt;br&gt;6&lt;br&gt;7&lt;br&gt;8&lt;br&gt;9&lt;br&gt;10&lt;br&gt;11&lt;br&gt;12&lt;br&gt;13&lt;br&gt;14&lt;br&gt;15&lt;br&gt;16&lt;br&gt;17&lt;br&gt;18&lt;br&gt;19&lt;br&gt;20&lt;br&gt;&lt;/pre&gt;			&lt;/td&gt;&lt;td&gt;
		&lt;pre&gt;&lt;pre&gt;&lt;span&gt;&lt;span&gt;require&lt;/span&gt; &lt;span&gt;&amp;#39;spec_helper&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;describe &lt;span&gt;Address&lt;/span&gt; &lt;span&gt;do&lt;/span&gt;&lt;br&gt;
&lt;span&gt;  #Test Fixture - Before Each test Create a Standard Bread with the following attributes and properties&lt;/span&gt;&lt;br&gt;  before(&lt;span&gt;:each&lt;/span&gt;) &lt;span&gt;do&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;@address&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; {&lt;br&gt;
      &lt;span&gt;:business_name&lt;/span&gt; =&amp;gt; &lt;span&gt;&amp;#39;business&amp;#39;&lt;/span&gt;, &lt;span&gt;:first_line&lt;/span&gt; =&amp;gt; &lt;span&gt;&amp;#39;10, This Street&amp;#39;&lt;/span&gt;, &lt;span&gt;:second_line&lt;/span&gt;=&amp;gt; &lt;span&gt;&amp;#39;erewhon&amp;#39;&lt;/span&gt;, &lt;span&gt;:town&lt;/span&gt;=&amp;gt; &lt;span&gt;&amp;#39;town&amp;#39;&lt;/span&gt;, &lt;span&gt;:county&lt;/span&gt;=&amp;gt;&lt;span&gt;&amp;#39;county&amp;#39;&lt;/span&gt;,&lt;br&gt;


      &lt;span&gt;:postcode&lt;/span&gt; =&amp;gt;&lt;span&gt;&amp;#39;AB12 3CD&amp;#39;&lt;/span&gt;, &lt;span&gt;:user_id&lt;/span&gt; =&amp;gt; &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;:lat&lt;/span&gt;=&amp;gt;&lt;span&gt;1.01&lt;/span&gt;, &lt;span&gt;:lng&lt;/span&gt;=&amp;gt;&lt;span&gt;2.02&lt;/span&gt;, &lt;span&gt;:status&lt;/span&gt;=&amp;gt;&lt;span&gt;Address&lt;/span&gt;::&lt;span&gt;JUST_REGISTERED&lt;/span&gt;, &lt;span&gt;:route_id&lt;/span&gt;=&amp;gt;&lt;span&gt;1&lt;/span&gt;&lt;br&gt;


    }&lt;br&gt;  &lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;  it &lt;span&gt;&amp;quot;should have a status of deleted after reset&amp;quot;&lt;/span&gt; &lt;span&gt;do&lt;/span&gt;&lt;br&gt;
&lt;br&gt;    &lt;span&gt;@address&lt;/span&gt;.reset&lt;br&gt;&lt;br&gt;    &lt;span&gt;@address&lt;/span&gt;.status.should &lt;span&gt;==&lt;/span&gt; &lt;span&gt;:Address&lt;/span&gt;::&lt;span&gt;DELETED&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;br&gt;Thanks David as well, but Tom was right, it was my typing that caused that issue.&lt;br&gt;
&lt;br&gt;Regards&lt;br&gt;&lt;br&gt;Matt&lt;br&gt;&lt;br&gt;
&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div&gt;2009/12/14 Tom Stuart &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785576&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tom@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex&quot;&gt;



&lt;div&gt;On 14 Dec 2009, at 20:36, Matt Riches wrote:&lt;div&gt;&lt;div&gt;&lt;br&gt;
&amp;gt; 1) Why are my methods undefined, when they are there (I can create the object via script/console and call the status and reset methods and see them work)&lt;br&gt;
&amp;gt; 2) What is the best way of resolving the issue&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;You&amp;#39;d be much better off using &lt;a href=&quot;http://pastie.org&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;pastie.org&lt;/a&gt; to show us the real code that&amp;#39;s having the problem, because your example contains all sorts of omissions and typos (which is likely to be the sort of thing that causes your problem!) and it&amp;#39;s impossible to tell how much of it is wrong in the original code versus how much was introduced by you rewriting it as an example.&lt;br&gt;




&lt;br&gt;
Cheers,&lt;br&gt;
-Tom&lt;br&gt;
_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785576&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br&gt;_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785576&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;-- &lt;br&gt;Vishu Ramanathan&lt;br&gt;
co-founder thinklink llc 312.436.1627&lt;br&gt;
new homepage! ---&amp;gt; &lt;a href=&quot;http://thinklinkllc.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;thinklinkllc.com&lt;/a&gt; &lt;br&gt;&lt;a href=&quot;http://mocklinkr.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;mocklinkr.com&lt;/a&gt; makes web mockups come to life&lt;br&gt;&lt;a href=&quot;http://thinklinkr.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;thinklinkr.com&lt;/a&gt; is the web-based collaborative outliner&lt;br&gt;


&lt;/font&gt;&lt;br&gt;_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785576&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785576&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/RSPEC-and-RoR-undefined-method-for-hash-when-running-model-tests-tp26784481p26785576.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26785476</id>
	<title>Re: RSPEC and RoR undefined method for hash when running model tests</title>
	<published>2009-12-14T13:39:22Z</published>
	<updated>2009-12-14T13:39:22Z</updated>
	<author>
		<name>Tom Stuart</name>
	</author>
	<content type="html">On 14 Dec 2009, at 21:28, Matt Riches wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; describe Address do
&lt;br&gt;&amp;gt; &amp;nbsp; #Test Fixture - Before Each test Create a Standard Bread with the following attributes and properties
&lt;br&gt;&amp;gt; &amp;nbsp; before(:each) do
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; @address = {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; :business_name =&amp;gt; 'business', :first_line =&amp;gt; '10, This Street', :second_line=&amp;gt; 'erewhon', :town=&amp;gt; 'town', :county=&amp;gt;'county',
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; :postcode =&amp;gt;'AB12 3CD', :user_id =&amp;gt; 1, :lat=&amp;gt;1.01, :lng=&amp;gt;2.02, :status=&amp;gt;Address::JUST_REGISTERED, :route_id=&amp;gt;1
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;nbsp; end
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; it &amp;quot;should have a status of deleted after reset&amp;quot; do
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; @address.reset
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; @address.status.should == :Address::DELETED
&lt;br&gt;&amp;gt; &amp;nbsp; end
&lt;br&gt;&amp;gt; end
&lt;/div&gt;&lt;br&gt;The problem is that you're setting @address to a hash, not an instance of Address. Did you mean @address = Address.new :business_name =&amp;gt; ...?
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;-Tom
&lt;br&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785476&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/RSPEC-and-RoR-undefined-method-for-hash-when-running-model-tests-tp26784481p26785476.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26785360</id>
	<title>Re: RSPEC and RoR undefined method for hash when running model tests</title>
	<published>2009-12-14T13:33:06Z</published>
	<updated>2009-12-14T13:33:06Z</updated>
	<author>
		<name>Vishu Ramanathan</name>
	</author>
	<content type="html">&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; &quot;&gt;&lt;div&gt;This should have been the giveaway &lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; &quot;&gt;
undefined method &amp;#39;status&amp;#39; for #&amp;lt;&lt;b&gt;Hash&lt;/b&gt;...&amp;gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;In your before you&amp;#39;re assigning @address to the parameters, not to a new address&lt;/div&gt;&lt;div&gt;@address = {:foo =&amp;gt; &amp;#39;bar&amp;#39;}&lt;/div&gt;
&lt;div&gt;instead of&lt;/div&gt;&lt;div&gt;@address = Address.new({:foo =&amp;gt; &amp;#39;bar&amp;#39;})&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;-V&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/span&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Dec 14, 2009 at 3:28 PM, Matt Riches &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785360&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mattriches@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;Fair point, thought you could also assume that the omissions are down to my newness at RSpec and RoR :-)&lt;br&gt;&lt;br&gt;The whole of the code is rather large, I am being asked to retrofit rspec onto the code base as things are changed, so I am only showing what I think are the relevent things..&lt;br&gt;


&lt;br&gt;&lt;h2&gt;Code Section &lt;/h2&gt;




	
	&lt;div&gt;
		&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
		&lt;tbody&gt;&lt;tr&gt;
			&lt;td&gt;
				
				&lt;pre&gt;1&lt;br&gt;2&lt;br&gt;3&lt;br&gt;4&lt;br&gt;5&lt;br&gt;6&lt;br&gt;7&lt;br&gt;8&lt;br&gt;9&lt;br&gt;10&lt;br&gt;11&lt;br&gt;12&lt;br&gt;13&lt;br&gt;14&lt;br&gt;15&lt;br&gt;16&lt;br&gt;17&lt;br&gt;18&lt;br&gt;19&lt;br&gt;20&lt;br&gt;21&lt;br&gt;22&lt;br&gt;23&lt;br&gt;24&lt;br&gt;25&lt;br&gt;26&lt;br&gt;27&lt;br&gt;28&lt;br&gt;29&lt;br&gt;30&lt;br&gt;31&lt;br&gt;32&lt;br&gt;
33&lt;br&gt;34&lt;br&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;td&gt;
		&lt;pre&gt;&lt;pre&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;class&lt;/span&gt; &lt;span&gt;Address&lt;span&gt; &amp;lt; ActiveRecord::Base&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;span&gt;  #Status Codes as Constants&lt;/span&gt;&lt;br&gt;  &lt;span&gt;JUST_REGISTERED&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;DELETED&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;1&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;DECLINED&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;2&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;APPROVED&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; &lt;span&gt;3&lt;/span&gt;&lt;br&gt;
&lt;br&gt;&lt;span&gt;&lt;span&gt;def&lt;/span&gt; &lt;span&gt;status&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;DELETED&lt;/span&gt;&lt;br&gt;&lt;/span&gt;&lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;  &lt;span&gt;&lt;span&gt;def&lt;/span&gt; &lt;span&gt;reset&lt;/span&gt;&lt;/span&gt;    &lt;br&gt;
&lt;span&gt;    #We don&amp;#39;t actually delete the record&lt;/span&gt;&lt;br&gt;&lt;span&gt;    #Instead a status field is set&lt;/span&gt;&lt;br&gt;
&lt;span&gt;    #And all the data is blanked for data protection reasons&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span&gt;self&lt;/span&gt;.status &lt;span&gt;=&lt;/span&gt; &lt;span&gt;DELETED&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.business_name &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.first_line &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.second_line &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.town &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.county &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.postcode &lt;span&gt;=&lt;/span&gt; &lt;span&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
&lt;span&gt;    #MR - added in the following fields&lt;/span&gt;&lt;br&gt;    &lt;span&gt;self&lt;/span&gt;.lat &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.lng &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0.0&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.route_id &lt;span&gt;=&lt;/span&gt; &lt;span&gt;0&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;self&lt;/span&gt;.save&lt;br&gt;  &lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;span&gt;#.. other code elided&lt;/span&gt;&lt;br&gt;
&lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/pre&gt;
		&lt;/td&gt;
		&lt;/tr&gt;
		&lt;/tbody&gt;&lt;/table&gt;
	
	&lt;/div&gt;


&lt;hr&gt;
&lt;h2&gt;RSpec &lt;/h2&gt;




	
	
		
		
			&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
				
				&lt;pre&gt;1&lt;br&gt;2&lt;br&gt;3&lt;br&gt;4&lt;br&gt;5&lt;br&gt;6&lt;br&gt;7&lt;br&gt;8&lt;br&gt;9&lt;br&gt;10&lt;br&gt;11&lt;br&gt;12&lt;br&gt;13&lt;br&gt;14&lt;br&gt;15&lt;br&gt;16&lt;br&gt;17&lt;br&gt;18&lt;br&gt;19&lt;br&gt;20&lt;br&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;td&gt;
		&lt;pre&gt;&lt;pre&gt;&lt;span&gt;&lt;span&gt;require&lt;/span&gt; &lt;span&gt;&amp;#39;spec_helper&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;describe &lt;span&gt;Address&lt;/span&gt; &lt;span&gt;do&lt;/span&gt;&lt;br&gt;
&lt;span&gt;  #Test Fixture - Before Each test Create a Standard Bread with the following attributes and properties&lt;/span&gt;&lt;br&gt;  before(&lt;span&gt;:each&lt;/span&gt;) &lt;span&gt;do&lt;/span&gt;&lt;br&gt;
    &lt;span&gt;@address&lt;/span&gt; &lt;span&gt;=&lt;/span&gt; {&lt;span&gt;&lt;/span&gt;&lt;br&gt;
      &lt;span&gt;:business_name&lt;/span&gt; =&amp;gt; &lt;span&gt;&amp;#39;business&amp;#39;&lt;/span&gt;, &lt;span&gt;:first_line&lt;/span&gt; =&amp;gt; &lt;span&gt;&amp;#39;10, This Street&amp;#39;&lt;/span&gt;, &lt;span&gt;:second_line&lt;/span&gt;=&amp;gt; &lt;span&gt;&amp;#39;erewhon&amp;#39;&lt;/span&gt;, &lt;span&gt;:town&lt;/span&gt;=&amp;gt; &lt;span&gt;&amp;#39;town&amp;#39;&lt;/span&gt;, &lt;span&gt;:county&lt;/span&gt;=&amp;gt;&lt;span&gt;&amp;#39;county&amp;#39;&lt;/span&gt;,&lt;br&gt;

      &lt;span&gt;:postcode&lt;/span&gt; =&amp;gt;&lt;span&gt;&amp;#39;AB12 3CD&amp;#39;&lt;/span&gt;, &lt;span&gt;:user_id&lt;/span&gt; =&amp;gt; &lt;span&gt;1&lt;/span&gt;, &lt;span&gt;:lat&lt;/span&gt;=&amp;gt;&lt;span&gt;1.01&lt;/span&gt;, &lt;span&gt;:lng&lt;/span&gt;=&amp;gt;&lt;span&gt;2.02&lt;/span&gt;, &lt;span&gt;:status&lt;/span&gt;=&amp;gt;&lt;span&gt;Address&lt;/span&gt;::&lt;span&gt;JUST_REGISTERED&lt;/span&gt;, &lt;span&gt;:route_id&lt;/span&gt;=&amp;gt;&lt;span&gt;1&lt;/span&gt;&lt;br&gt;

    }&lt;br&gt;  &lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;  it &lt;span&gt;&amp;quot;should have a status of deleted after reset&amp;quot;&lt;/span&gt; &lt;span&gt;do&lt;/span&gt;&lt;br&gt;
&lt;br&gt;    &lt;span&gt;@address&lt;/span&gt;.reset&lt;br&gt;&lt;br&gt;    &lt;span&gt;@address&lt;/span&gt;.status.should &lt;span&gt;==&lt;/span&gt; &lt;span&gt;:Address&lt;/span&gt;::&lt;span&gt;DELETED&lt;/span&gt;&lt;br&gt;
  &lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;span&gt;end&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;br&gt;Thanks David as well, but Tom was right, it was my typing that caused that issue.&lt;br&gt;
&lt;br&gt;Regards&lt;br&gt;&lt;br&gt;Matt&lt;br&gt;&lt;br&gt;
&lt;div class=&quot;gmail_quote&quot;&gt;&lt;div class=&quot;im&quot;&gt;2009/12/14 Tom Stuart &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785360&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tom@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex&quot;&gt;


&lt;div&gt;On 14 Dec 2009, at 20:36, Matt Riches wrote:&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&amp;gt; 1) Why are my methods undefined, when they are there (I can create the object via script/console and call the status and reset methods and see them work)&lt;br&gt;
&amp;gt; 2) What is the best way of resolving the issue&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;You&amp;#39;d be much better off using &lt;a href=&quot;http://pastie.org&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;pastie.org&lt;/a&gt; to show us the real code that&amp;#39;s having the problem, because your example contains all sorts of omissions and typos (which is likely to be the sort of thing that causes your problem!) and it&amp;#39;s impossible to tell how much of it is wrong in the original code versus how much was introduced by you rewriting it as an example.&lt;br&gt;



&lt;br&gt;
Cheers,&lt;br&gt;
-Tom&lt;br&gt;
_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785360&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br&gt;_______________________________________________&lt;br&gt;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785360&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Vishu Ramanathan&lt;br&gt;co-founder thinklink llc 312.436.1627&lt;br&gt;
new homepage! ---&amp;gt; &lt;a href=&quot;http://thinklinkllc.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;thinklinkllc.com&lt;/a&gt; &lt;br&gt;&lt;a href=&quot;http://mocklinkr.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mocklinkr.com&lt;/a&gt; makes web mockups come to life&lt;br&gt;&lt;a href=&quot;http://thinklinkr.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;thinklinkr.com&lt;/a&gt; is the web-based collaborative outliner&lt;br&gt;

&lt;br /&gt;_______________________________________________
&lt;br&gt;rspec-users mailing list
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26785360&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://rubyforge.org/mailman/listinfo/rspec-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://rubyforge.org/mailman/listinfo/rspec-users&lt;/a&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/rspec-users-f17460.html&quot; embed=&quot;fixTarget[17460]&quot; target=&quot;_top&quot; &gt;rspec-users&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/RSPEC-and-RoR-undefined-method-for-hash-when-running-model-tests-tp26784481p26785360.html" />
</entry>

</feed>
