<?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-15T09:05:43Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/RSpec-f17459.xml" />
	<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-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>

<entry>
	<id>tag:old.nabble.com,2006:post-26785233</id>
	<title>Re: RSPEC and RoR undefined method for hash when running model tests</title>
	<published>2009-12-14T13:28:42Z</published>
	<updated>2009-12-14T13:28:42Z</updated>
	<author>
		<name>Matt Riches</name>
	</author>
	<content type="html">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 class=&quot;allcode&quot;&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 class=&quot;textmate-source-numbers&quot;&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 class=&quot;textmate-source&quot;&gt;&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;meta meta_rails meta_rails_model&quot;&gt;&lt;span class=&quot;meta meta_class meta_class_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_class keyword_control_class_ruby&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_ruby&quot;&gt;Address&lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_ruby&quot;&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 class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;  #Status Codes as Constants&lt;/span&gt;&lt;br&gt;  &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;JUST_REGISTERED&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;0&lt;/span&gt;&lt;br&gt;
  &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;DELETED&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;1&lt;/span&gt;&lt;br&gt;
  &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;DECLINED&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;2&lt;/span&gt;&lt;br&gt;
  &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;APPROVED&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;3&lt;/span&gt;&lt;br&gt;
&lt;br&gt;&lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;status&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
  &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;DELETED&lt;/span&gt;&lt;br&gt;&lt;/span&gt;&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;  &lt;span class=&quot;meta meta_function meta_function_method meta_function_method_without-arguments meta_function_method_without-arguments_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_def keyword_control_def_ruby&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_ruby&quot;&gt;reset&lt;/span&gt;&lt;/span&gt;    &lt;br&gt;
&lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;    #We don&amp;#39;t actually delete the record&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;    #Instead a status field is set&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;    #And all the data is blanked for data protection reasons&lt;/span&gt;&lt;br&gt;&lt;br&gt;    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.status &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;DELETED&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.business_name &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.first_line &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.second_line &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.town &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.county &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.postcode &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;    #MR - added in the following fields&lt;/span&gt;&lt;br&gt;    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.lat &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;0.0&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.lng &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;0.0&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.route_id &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;0&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_language variable_language_ruby&quot;&gt;self&lt;/span&gt;.save&lt;br&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&gt;#.. other code elided&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&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 class=&quot;textmate-source-numbers&quot;&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 class=&quot;textmate-source&quot;&gt;&lt;pre class=&quot;sunburst&quot;&gt;&lt;span class=&quot;meta meta_require meta_require_ruby&quot;&gt;&lt;span class=&quot;keyword keyword_other keyword_other_special-method keyword_other_special-method_ruby&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;spec_helper&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;describe &lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;Address&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby&quot;&gt;do&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;comment comment_line comment_line_number-sign comment_line_number-sign_ruby&quot;&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 class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:each&lt;/span&gt;) &lt;span class=&quot;keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby&quot;&gt;do&lt;/span&gt;&lt;br&gt;
    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;@address&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby&quot;&gt;=&lt;/span&gt; {&lt;span class=&quot;meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block&quot;&gt;&lt;/span&gt;&lt;br&gt;
      &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:business_name&lt;/span&gt; =&amp;gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;business&amp;#39;&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:first_line&lt;/span&gt; =&amp;gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;10, This Street&amp;#39;&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:second_line&lt;/span&gt;=&amp;gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;erewhon&amp;#39;&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:town&lt;/span&gt;=&amp;gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;town&amp;#39;&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:county&lt;/span&gt;=&amp;gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;county&amp;#39;&lt;/span&gt;,&lt;br&gt;
      &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:postcode&lt;/span&gt; =&amp;gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_ruby&quot;&gt;&amp;#39;AB12 3CD&amp;#39;&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:user_id&lt;/span&gt; =&amp;gt; &lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;1&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:lat&lt;/span&gt;=&amp;gt;&lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;1.01&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:lng&lt;/span&gt;=&amp;gt;&lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;2.02&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:status&lt;/span&gt;=&amp;gt;&lt;span class=&quot;support support_class support_class_ruby&quot;&gt;Address&lt;/span&gt;::&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;JUST_REGISTERED&lt;/span&gt;, &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:route_id&lt;/span&gt;=&amp;gt;&lt;span class=&quot;constant constant_numeric constant_numeric_ruby&quot;&gt;1&lt;/span&gt;&lt;br&gt;
    }&lt;br&gt;  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;  it &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_ruby&quot;&gt;&amp;quot;should have a status of deleted after reset&amp;quot;&lt;/span&gt; &lt;span class=&quot;keyword keyword_control keyword_control_start-block keyword_control_start-block_ruby&quot;&gt;do&lt;/span&gt;&lt;br&gt;
&lt;br&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;@address&lt;/span&gt;.reset&lt;br&gt;&lt;br&gt;    &lt;span class=&quot;variable variable_other variable_other_readwrite variable_other_readwrite_instance variable_other_readwrite_instance_ruby&quot;&gt;@address&lt;/span&gt;.status.should &lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_symbol constant_other_symbol_ruby&quot;&gt;:Address&lt;/span&gt;::&lt;span class=&quot;variable variable_other variable_other_constant variable_other_constant_ruby&quot;&gt;DELETED&lt;/span&gt;&lt;br&gt;
  &lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&gt;end&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;span class=&quot;keyword keyword_control keyword_control_ruby&quot;&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;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=26785233&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;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;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;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=26785233&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=26785233&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-tp26784481p26785233.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26784934</id>
	<title>Re: RSPEC and RoR undefined method for hash when running model tests</title>
	<published>2009-12-14T13:04:09Z</published>
	<updated>2009-12-14T13:04:09Z</updated>
	<author>
		<name>David Salgado</name>
	</author>
	<content type="html">Looks like you forgot to put &amp;quot;do&amp;quot; at the end of your specs. I do that
&lt;br&gt;all the time;
&lt;br&gt;&lt;br&gt;it &amp;quot;should have a status of New Record&amp;quot;
&lt;br&gt;...
&lt;br&gt;&lt;br&gt;Should be
&lt;br&gt;&lt;br&gt;&lt;br&gt;it &amp;quot;should have a status of New Record&amp;quot; do
&lt;br&gt;...
&lt;br&gt;&lt;br&gt;HTH
&lt;br&gt;&lt;br&gt;David
&lt;br&gt;&lt;br&gt;2009/12/14 Tom Stuart &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26784934&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tom@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On 14 Dec 2009, at 20:36, Matt Riches wrote:
&lt;br&gt;&amp;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;&amp;gt; 2) What is the best way of resolving the issue
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You'd be much better off using pastie.org to show us the real code that'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'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;&amp;gt;
&lt;br&gt;&amp;gt; Cheers,
&lt;br&gt;&amp;gt; -Tom
&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=26784934&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;br&gt;&amp;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=26784934&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/RSPEC-and-RoR-undefined-method-for-hash-when-running-model-tests-tp26784481p26784934.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26784675</id>
	<title>Re: RSPEC and RoR undefined method for hash when running model tests</title>
	<published>2009-12-14T12:54:26Z</published>
	<updated>2009-12-14T12:54:26Z</updated>
	<author>
		<name>Tom Stuart</name>
	</author>
	<content type="html">On 14 Dec 2009, at 20:36, Matt Riches wrote:
&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;You'd be much better off using pastie.org to show us the real code that'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'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=26784675&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-tp26784481p26784675.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26784481</id>
	<title>RSPEC and RoR undefined method for hash when running model tests</title>
	<published>2009-12-14T12:36:48Z</published>
	<updated>2009-12-14T12:36:48Z</updated>
	<author>
		<name>Matt Riches</name>
	</author>
	<content type="html">&lt;div&gt;Within my project, I have a number of models that have additional methods within them other than those provided by active record.&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;as an example (to keep it short and sweet)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;class foo &amp;lt; ActiveRecod::Base&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;def status&lt;/div&gt;&lt;div&gt;    &amp;quot;New Record&amp;quot;&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;def reset&lt;/div&gt;&lt;div&gt;    &amp;quot;Reset&amp;quot;&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;in my spec file I have &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;require &amp;#39;spec_helper&amp;#39;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;describe Foo do&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;before(:each) do&lt;/div&gt;&lt;div&gt;
  @foo = Foo.new()&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;it &amp;quot;should have a status of New Record&amp;quot;&lt;/div&gt;&lt;div&gt;    @foo.status.should == &amp;quot;New Record&amp;quot;&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;it &amp;quot;should have a status of Reset after reset&amp;quot;&lt;/div&gt;
&lt;div&gt;    @foo.reset.should == &amp;quot;Reset&amp;quot;&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;end&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;however, when I run rake spec I get &lt;/div&gt;&lt;div&gt;NoMethodError in &amp;#39;Foo should have a status of New Record&amp;#39;&lt;/div&gt;&lt;div&gt;
undefined method &amp;#39;status&amp;#39; for #&amp;lt;Hash...&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;and an equivalent one for the other method.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I am sure that this is something fundamental in my understanding, but I&amp;#39;m scuppered. I have spent the best part of a day trying to resolve this.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;so, &lt;/div&gt;&lt;div&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;/div&gt;&lt;div&gt;2) What is the best way of resolving the issue&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thanks&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&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=26784481&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/RSPEC-and-RoR-undefined-method-for-hash-when-running-model-tests-tp26784481p26784481.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26783309</id>
	<title>Re: Problem with Before Filters</title>
	<published>2009-12-14T11:25:29Z</published>
	<updated>2009-12-14T11:25:29Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Mon, Dec 14, 2009 at 3:26 AM, Andrei Erdoss &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26783309&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;erdoss@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, Dec 14, 2009 at 9:05 AM, Amit Kulkarni &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26783309&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks David,
&lt;br&gt;&amp;gt;&amp;gt; Now in spec when i write login_as :admin then there must be some method
&lt;br&gt;&amp;gt;&amp;gt; written for login_as?
&lt;br&gt;&amp;gt;&amp;gt; Now if there are before filters in controller then do we need to write
&lt;br&gt;&amp;gt;&amp;gt; each and every method or it is indeed taken care of but the developer
&lt;br&gt;&amp;gt;&amp;gt; and we need to just have to pass the value for that particular before
&lt;br&gt;&amp;gt;&amp;gt; filters.
&lt;br&gt;&amp;gt;&amp;gt; For e.g.
&lt;br&gt;&amp;gt;&amp;gt; If i have a before filter in controller as
&lt;br&gt;&amp;gt;&amp;gt; before_filter :admin_access_required, :except=&amp;gt;[ :view,
&lt;br&gt;&amp;gt;&amp;gt; :update_presentation]
&lt;br&gt;&amp;gt;&amp;gt; Now in my spec do i need to pass only the value like
&lt;br&gt;&amp;gt;&amp;gt; admin_access_required :admin
&lt;br&gt;&amp;gt;&amp;gt; or i need to write some method for the same
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You can write a stub method that would return a value such that your object
&lt;br&gt;&amp;gt; meets the admin_required_access requirement.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; controller.stub(:admin_access_required).and_return(true)
&lt;/div&gt;&lt;br&gt;That _could_ work, but methods like admin_access_required are often
&lt;br&gt;implemented such that they modify the internal state of the
&lt;br&gt;controller, setting the user on its internal session or request
&lt;br&gt;object. If the behaviour subsequently invoked by the example needs to
&lt;br&gt;access that state, this wouldn't work.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;David
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Andrei Erdoss
&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=26783309&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/Problem-with-Before-Filters-tp26723297p26783309.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26783292</id>
	<title>Re: Problem with Before Filters</title>
	<published>2009-12-14T11:22:32Z</published>
	<updated>2009-12-14T11:22:32Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Mon, Dec 14, 2009 at 1:05 AM, Amit Kulkarni &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26783292&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Thanks David,
&lt;br&gt;&amp;gt; Now in spec when i write login_as :admin then there must be some method
&lt;br&gt;&amp;gt; written for login_as?
&lt;br&gt;&lt;br&gt;That would be a helper that you write yourself or is provided by the
&lt;br&gt;authentication framework you're using. It lives in the spec suite, not
&lt;br&gt;in the controller code, and does whatever is necessary to either
&lt;br&gt;actually log in. The most black box approach is to post to the
&lt;br&gt;controller that manages logging in.
&lt;br&gt;&lt;br&gt;What it looks like depends on how you design your authentication
&lt;br&gt;system. restful_authentication, for example, ships with login_as and
&lt;br&gt;authorize_as methods that set session variables directly.
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;David
&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=26783292&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/Problem-with-Before-Filters-tp26723297p26783292.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26777215</id>
	<title>Re: Stub activerecord find given instance?</title>
	<published>2009-12-14T04:39:20Z</published>
	<updated>2009-12-14T04:39:20Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Sat, Dec 12, 2009 at 1:35 PM, Saverio Miroddi &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26777215&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Tom Stuart wrote:
&lt;br&gt;&amp;gt;&amp;gt; On 10 Nov 2009, at 14:08, Saverio Miroddi wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Is there a clean/simple way of stubbing the activerecord find() for a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; single instance?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; MyModel.stub(:find).with(42).and_return(myModel)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Didn't work as expected - I'll do a bit of research and post again.
&lt;br&gt;&lt;br&gt;What is expected? What are you trying to accomplish?
&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=26777215&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/Stub-activerecord-find-given-instance--tp26284131p26777215.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26775476</id>
	<title>Re: undefined method `route_for</title>
	<published>2009-12-14T02:01:14Z</published>
	<updated>2009-12-14T02:01:14Z</updated>
	<author>
		<name>Andrew Premdas</name>
	</author>
	<content type="html">&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/14 Amit Kulkarni &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26775476&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&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;
Thanks David.&lt;br&gt;
Also i am little bit confused regarding routes.&lt;br&gt;
&lt;br&gt;
Consider a routing example&lt;br&gt;
&lt;br&gt;
it &amp;quot;should map { :controller =&amp;gt; &amp;#39;channels&amp;#39;, :action =&amp;gt; &amp;#39;new&amp;#39; } to&lt;br&gt;
/channels/new&amp;quot; do&lt;br&gt;
  route_for(:controller =&amp;gt; &amp;quot;channels&amp;quot;, :action =&amp;gt; &amp;quot;new&amp;quot;).should ==&lt;br&gt;
&amp;quot;/channels/new&amp;quot;&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
Now i can see all the routing methods by rake routes.In that i can see&lt;br&gt;
this new action defined.&lt;br&gt;
&lt;br&gt;
Now imagine if i write an action which is not defined in the rake routes&lt;br&gt;
then instead of failing it is passing.For e.g.&lt;br&gt;
&lt;br&gt;
it &amp;quot;should map { :controller =&amp;gt; &amp;#39;channels&amp;#39;, :action =&amp;gt; &amp;#39;test&amp;#39; } to&lt;br&gt;
/channels/test&amp;quot; do&lt;br&gt;
  route_for(:controller =&amp;gt; &amp;quot;channels&amp;quot;, :action =&amp;gt; &amp;quot;test&amp;quot;).should ==&lt;br&gt;
&amp;quot;/channels/test&amp;quot;&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
Now here &amp;#39;test&amp;#39; action is not defined in the routes.So it should fail&lt;br&gt;
but it isn&amp;#39;t.&lt;br&gt;
May be i am missing something here.&lt;br&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;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Are you sure you have the default last two lines commented out in routes.rb. If you haven&amp;#39;t they will match that action - I think.&lt;/div&gt;
&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;All best&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Andrew&lt;/div&gt;&lt;div&gt;&lt;br&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;div&gt;&lt;div class=&quot;h5&quot;&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;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26775476&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=26775476&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/undefined-method-%60route_for-tp26282804p26775476.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26775013</id>
	<title>Re: Problem with Before Filters</title>
	<published>2009-12-14T01:26:07Z</published>
	<updated>2009-12-14T01:26:07Z</updated>
	<author>
		<name>Andrei Erdoss</name>
	</author>
	<content type="html">You can write a stub method that would return a value such that your object meets the admin_required_access requirement.&lt;br&gt;&lt;br&gt;controller.stub(:admin_access_required).and_return(true) &lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Mon, Dec 14, 2009 at 9:05 AM, Amit Kulkarni &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26775013&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;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;Thanks David,&lt;br&gt;
Now in spec when i write login_as :admin then there must be some method&lt;br&gt;
written for login_as?&lt;br&gt;
Now if there are before filters in controller then do we need to write&lt;br&gt;
each and every method or it is indeed taken care of but the developer&lt;br&gt;
and we need to just have to pass the value for that particular before&lt;br&gt;
filters.&lt;br&gt;
For e.g.&lt;br&gt;
If i have a before filter in controller as&lt;br&gt;
before_filter :admin_access_required, :except=&amp;gt;[ :view,&lt;br&gt;
:update_presentation]&lt;br&gt;
Now in my spec do i need to pass only the value like&lt;br&gt;
admin_access_required :admin&lt;br&gt;
or i need to write some method for the same&lt;br&gt;
&lt;font color=&quot;#888888&quot;&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;
rspec-users mailing list&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26775013&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;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Andrei Erdoss&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=26775013&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/Problem-with-Before-Filters-tp26723297p26775013.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26773854</id>
	<title>Re: undefined method `route_for</title>
	<published>2009-12-13T23:18:17Z</published>
	<updated>2009-12-13T23:18:17Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">Thanks David.
&lt;br&gt;Also i am little bit confused regarding routes.
&lt;br&gt;&lt;br&gt;Consider a routing example
&lt;br&gt;&lt;br&gt;it &amp;quot;should map { :controller =&amp;gt; 'channels', :action =&amp;gt; 'new' } to 
&lt;br&gt;/channels/new&amp;quot; do
&lt;br&gt;&amp;nbsp; route_for(:controller =&amp;gt; &amp;quot;channels&amp;quot;, :action =&amp;gt; &amp;quot;new&amp;quot;).should == 
&lt;br&gt;&amp;quot;/channels/new&amp;quot;
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;Now i can see all the routing methods by rake routes.In that i can see 
&lt;br&gt;this new action defined.
&lt;br&gt;&lt;br&gt;Now imagine if i write an action which is not defined in the rake routes 
&lt;br&gt;then instead of failing it is passing.For e.g.
&lt;br&gt;&lt;br&gt;it &amp;quot;should map { :controller =&amp;gt; 'channels', :action =&amp;gt; 'test' } to 
&lt;br&gt;/channels/test&amp;quot; do
&lt;br&gt;&amp;nbsp; route_for(:controller =&amp;gt; &amp;quot;channels&amp;quot;, :action =&amp;gt; &amp;quot;test&amp;quot;).should == 
&lt;br&gt;&amp;quot;/channels/test&amp;quot;
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;Now here 'test' action is not defined in the routes.So it should fail 
&lt;br&gt;but it isn't.
&lt;br&gt;May be i am missing something here.
&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=26773854&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/undefined-method-%60route_for-tp26282804p26773854.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26773768</id>
	<title>Re: Problem with Before Filters</title>
	<published>2009-12-13T23:05:21Z</published>
	<updated>2009-12-13T23:05:21Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">Thanks David,
&lt;br&gt;Now in spec when i write login_as :admin then there must be some method 
&lt;br&gt;written for login_as?
&lt;br&gt;Now if there are before filters in controller then do we need to write 
&lt;br&gt;each and every method or it is indeed taken care of but the developer 
&lt;br&gt;and we need to just have to pass the value for that particular before 
&lt;br&gt;filters.
&lt;br&gt;For e.g.
&lt;br&gt;If i have a before filter in controller as
&lt;br&gt;before_filter :admin_access_required, :except=&amp;gt;[ :view, 
&lt;br&gt;:update_presentation]
&lt;br&gt;Now in my spec do i need to pass only the value like
&lt;br&gt;admin_access_required :admin
&lt;br&gt;or i need to write some method for the same
&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=26773768&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/Problem-with-Before-Filters-tp26723297p26773768.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26772733</id>
	<title>Re: Example vs ExampleProxy</title>
	<published>2009-12-13T19:59:14Z</published>
	<updated>2009-12-13T19:59:14Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Sun, Dec 13, 2009 at 2:58 PM, Sean Grove &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26772733&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; Hey all,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm working on bring DeepTest up to compatibility with rspec 1.2.9 in order
&lt;br&gt;&amp;gt; to parallelize tests, and hit a few roadblocks after 1.1.12. Specifically, I
&lt;br&gt;&amp;gt; was wondering about ExampleProxy (which I know now is for the custom
&lt;br&gt;&amp;gt; formatter) vs Example.
&lt;br&gt;&lt;br&gt;Any formatter - builtin or custom.
&lt;br&gt;&lt;br&gt;&amp;gt; Previously I would call run() on an Example, but
&lt;br&gt;&amp;gt; that's no longer a method on the ExampleProxy objects - is there a way to
&lt;br&gt;&amp;gt; grab the Example object from an ExampleProxy, or am I going about this the
&lt;br&gt;&amp;gt; wrong way(TM)?
&lt;br&gt;&lt;br&gt;The proxies don't have refs back to the examples by design. Need to
&lt;br&gt;find a means of accessing the examples directly, not their proxies.
&lt;br&gt;&lt;br&gt;Unfortunately, there is not really a good extension point for this
&lt;br&gt;right now. I'll add one for the next release, but in the mean time
&lt;br&gt;you'll need to replace line 30 in deep_test/spec/runner.rb with
&lt;br&gt;something like this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; examples = example_groups.map do |g|
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; proxies = g.send(:examples_to_run)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; proxies.map {|p| g.new(p, &amp;g.example_implementations[p])}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end.flatten
&lt;br&gt;&lt;br&gt;That's untested, but should give you the basic idea. If this can wait
&lt;br&gt;a bit, let's coordinate off list and work out a good extension point -
&lt;br&gt;I'll do a release in the next week or so that exposes it and you can
&lt;br&gt;follow up w/ your release. Good?
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;David
&lt;br&gt;&lt;br&gt;&amp;gt; Thanks for your help.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Sean
&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=26772733&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;br&gt;&amp;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=26772733&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/Example-vs-ExampleProxy-tp26769905p26772733.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26769905</id>
	<title>Example vs ExampleProxy</title>
	<published>2009-12-13T12:58:37Z</published>
	<updated>2009-12-13T12:58:37Z</updated>
	<author>
		<name>Sean Grove</name>
	</author>
	<content type="html">Hey all,
&lt;br&gt;&lt;br&gt;I'm working on bring DeepTest up to compatibility with rspec 1.2.9 in &amp;nbsp;
&lt;br&gt;order to parallelize tests, and hit a few roadblocks after 1.1.12. &amp;nbsp;
&lt;br&gt;Specifically, I was wondering about ExampleProxy (which I know now is &amp;nbsp;
&lt;br&gt;for the custom formatter) vs Example. Previously I would call run() on &amp;nbsp;
&lt;br&gt;an Example, but that's no longer a method on the ExampleProxy objects &amp;nbsp;
&lt;br&gt;- is there a way to grab the Example object from an ExampleProxy, or &amp;nbsp;
&lt;br&gt;am I going about this the wrong way(TM)?
&lt;br&gt;&lt;br&gt;Thanks for your help.
&lt;br&gt;&lt;br&gt;Sean
&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=26769905&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/Example-vs-ExampleProxy-tp26769905p26769905.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26760511</id>
	<title>Re: Stub activerecord find given instance?</title>
	<published>2009-12-12T11:35:10Z</published>
	<updated>2009-12-12T11:35:10Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">Tom Stuart wrote:
&lt;br&gt;&amp;gt; On 10 Nov 2009, at 14:08, Saverio Miroddi wrote:
&lt;br&gt;&amp;gt;&amp;gt; Is there a clean/simple way of stubbing the activerecord find() for a
&lt;br&gt;&amp;gt;&amp;gt; single instance?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; MyModel.stub(:find).with(42).and_return(myModel)
&lt;br&gt;&lt;br&gt;Didn't work as expected - I'll do a bit of research and post again.
&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=26760511&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/Stub-activerecord-find-given-instance--tp26284131p26760511.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26760020</id>
	<title>Re: Error Running Standalone/Command Line rspec: undefined method Pathname</title>
	<published>2009-12-12T10:29:40Z</published>
	<updated>2009-12-12T10:29:40Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Sat, Dec 12, 2009 at 11:28 AM, athem &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26760020&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;allan.m.miller@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've written the following simple rspec test that I'm trying to run
&lt;br&gt;&amp;gt; (rspec 1.2.9) standalone (outside Rails) from the command line and
&lt;br&gt;&amp;gt; getting the following error.  Any idea for how to fix this?  Thanks.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; $&amp;gt;  spec foo_rspec.rb
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; /Users/athem/.gem/ruby/1.8/gems/rspec-1.2.9/lib/spec/runner/options.rb:
&lt;br&gt;&amp;gt; 108:in `determine_project_root': undefined method `Pathname' for
&lt;br&gt;&amp;gt; #&amp;lt;Spec::Runner::Options:0x14dc1e4&amp;gt; (NoMethodError).
&lt;/div&gt;&lt;br&gt;There is a require 'pathname' statement in the method in options.rb
&lt;br&gt;that calls determine_project_root. Please try adding that to the
&lt;br&gt;beginning of your spec file and see if it works. If so, we'll need to
&lt;br&gt;investigate more to find out why it doesn't work for you as/is when it
&lt;br&gt;works for everyone else.
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;David
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; foo_rspec.rb file:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; require 'spec_helper'
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; class Foo
&lt;br&gt;&amp;gt; end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; describe &amp;quot;A Foo that says boo&amp;quot; do
&lt;br&gt;&amp;gt;  before(:each) do
&lt;br&gt;&amp;gt;    @foo = Foo.new
&lt;br&gt;&amp;gt;  end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  it &amp;quot;should say boo&amp;quot; do
&lt;br&gt;&amp;gt;    @foo.should say_boo
&lt;br&gt;&amp;gt;  end
&lt;br&gt;&amp;gt; end
&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=26760020&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;br&gt;&amp;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=26760020&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/Error-Running-Standalone-Command-Line-rspec%3A-undefined-method-Pathname-tp26759980p26760020.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26759980</id>
	<title>Error Running Standalone/Command Line rspec: undefined method Pathname</title>
	<published>2009-12-12T09:28:48Z</published>
	<updated>2009-12-12T09:28:48Z</updated>
	<author>
		<name>Allan Miller-3</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I've written the following simple rspec test that I'm trying to run
&lt;br&gt;(rspec 1.2.9) standalone (outside Rails) from the command line and
&lt;br&gt;getting the following error. &amp;nbsp;Any idea for how to fix this? &amp;nbsp;Thanks.
&lt;br&gt;&lt;br&gt;$&amp;gt; &amp;nbsp;spec foo_rspec.rb
&lt;br&gt;&lt;br&gt;/Users/athem/.gem/ruby/1.8/gems/rspec-1.2.9/lib/spec/runner/options.rb:
&lt;br&gt;108:in `determine_project_root': undefined method `Pathname' for
&lt;br&gt;#&amp;lt;Spec::Runner::Options:0x14dc1e4&amp;gt; (NoMethodError).
&lt;br&gt;&lt;br&gt;foo_rspec.rb file:
&lt;br&gt;&lt;br&gt;&lt;br&gt;require 'spec_helper'
&lt;br&gt;&lt;br&gt;class Foo
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;describe &amp;quot;A Foo that says boo&amp;quot; do
&lt;br&gt;&amp;nbsp; before(:each) do
&lt;br&gt;&amp;nbsp; &amp;nbsp; @foo = Foo.new
&lt;br&gt;&amp;nbsp; end
&lt;br&gt;&lt;br&gt;&amp;nbsp; it &amp;quot;should say boo&amp;quot; do
&lt;br&gt;&amp;nbsp; &amp;nbsp; @foo.should say_boo
&lt;br&gt;&amp;nbsp; end
&lt;br&gt;end
&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=26759980&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/Error-Running-Standalone-Command-Line-rspec%3A-undefined-method-Pathname-tp26759980p26759980.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26754526</id>
	<title>Re: Cuke4PHP Was: RSpec wire protocol Was:Re: describe &quot;RSpec's documentation&quot; do</title>
	<published>2009-12-11T18:53:54Z</published>
	<updated>2009-12-11T18:53:54Z</updated>
	<author>
		<name>Matt Wynne</name>
	</author>
	<content type="html">Let's move this bit of the discussion over to the cukes mailing list. &amp;nbsp;
&lt;br&gt;Are you on that list Ed?
&lt;br&gt;&lt;br&gt;On 11 Dec 2009, at 22:29, Ed Howland wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; BTW, does Cuke's wire protocol allow for a mixture of Ruby side and
&lt;br&gt;&amp;gt; SUT side step definitions?
&lt;br&gt;&lt;br&gt;Yes. With Cucumber you can implement steps in a mixture of any of the &amp;nbsp;
&lt;br&gt;supported languages, including Ruby code, and any number of wire &amp;nbsp;
&lt;br&gt;servers.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; BTW, anyone working on a Cuke4PHP?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; That's the first time I've heard anyone even suggest it :) I'd be &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; happy to
&lt;br&gt;&amp;gt;&amp;gt; collaborate with someone if they wanted some help with that.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I seriously need this. And am willing to help. Currently we are using
&lt;br&gt;&amp;gt; Cuke+Webrat+Mechanize to test only the web facing surface of the app.
&lt;br&gt;&amp;gt; But to get things like 'Given I have a user named &amp;quot;Ted&amp;quot; with password
&lt;br&gt;&amp;gt; &amp;quot;Secret&amp;quot;' &amp;nbsp;to work and insert into the legacy DB is tricky. If that
&lt;br&gt;&amp;gt; step could execute on the PHP side, life would be sweet!
&lt;/div&gt;&lt;br&gt;The protocol is documented in the features here:
&lt;br&gt;&lt;a href=&quot;http://github.com/mattwynne/cucumber/blob/master/features/wire_protocol.feature&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/mattwynne/cucumber/blob/master/features/wire_protocol.feature&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://github.com/mattwynne/cucumber/blob/master/features/wire_protocol_table_diffing.feature&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/mattwynne/cucumber/blob/master/features/wire_protocol_table_diffing.feature&lt;/a&gt;&lt;br&gt;&lt;br&gt;Richard Lawrence has written the reference implementation of a server &amp;nbsp;
&lt;br&gt;in .NET:
&lt;br&gt;&lt;a href=&quot;http://github.com/richardlawrence/Cuke4Nuke&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/richardlawrence/Cuke4Nuke&lt;/a&gt;&lt;br&gt;&lt;br&gt;The great thing about how Richard has implemented his server is he's &amp;nbsp;
&lt;br&gt;written end-to-end tests (in cucumber) that make sure the whole thing &amp;nbsp;
&lt;br&gt;works. See for example
&lt;br&gt;&lt;a href=&quot;http://github.com/richardlawrence/Cuke4Nuke/blob/master/features/cuke4nuke.feature&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/richardlawrence/Cuke4Nuke/blob/master/features/cuke4nuke.feature&lt;/a&gt;&lt;br&gt;&lt;br&gt;&amp;gt; AFAIK, there seems to be simple REST servers in at least .Net and PHP.
&lt;br&gt;&amp;gt; Fitzgerald for PHP and just using IIS and writing handlers in .Net.
&lt;br&gt;&lt;br&gt;That's great, but we don't use REST for cucumber's wire protocol as I &amp;nbsp;
&lt;br&gt;explained. Dragging the might of IIS around in order to test a &amp;nbsp;
&lt;br&gt;winforms app, for example, would be pretty bonkers IMO.
&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Matt
&lt;br&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;+447974 430184
&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=26754526&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-wire-protocol-Was%3ARe%3A-describe-%22RSpec%27s-documentation%22-do-tp26703150p26754526.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26752491</id>
	<title>Re: RSpec wire protocol Was:Re: describe &quot;RSpec's documentation&quot; do</title>
	<published>2009-12-11T14:29:21Z</published>
	<updated>2009-12-11T14:29:21Z</updated>
	<author>
		<name>Ed Howland</name>
	</author>
	<content type="html">On Fri, Dec 11, 2009 at 9:03 AM, Matt Wynne &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26752491&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;matt@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Yes we did, briefly - probably before the discussion went online on the
&lt;br&gt;&amp;gt; lighthouse ticket. I think there were a couple of reasons why not REST:
&lt;br&gt;&amp;gt; (1) simplicity - we wanted the wire server to be as low-tech as possible so
&lt;br&gt;&amp;gt; it would be easy and lightweight to implement on any platform (think
&lt;br&gt;&amp;gt; Cuke4EmbeddedDevice). Everyone's got a TCP stack but not everyone's got a
&lt;br&gt;&amp;gt; simple web server like sinatra - I'm not even sure there's an especially
&lt;br&gt;&amp;gt; simple one for .NET
&lt;br&gt;&amp;gt; (2) flexibility - as the protocol has emerged, it's become clear that the
&lt;br&gt;&amp;gt; relationship is pretty much client / server, but when we first started we
&lt;br&gt;&amp;gt; weren't sure how much chatter would need to go back &amp; forth. Obviously a
&lt;br&gt;&amp;gt; REST server can't start making requests back to a client (unless that client
&lt;br&gt;&amp;gt; also starts offering a web server), but if you've got two peers talking over
&lt;br&gt;&amp;gt; a socket you can have two-way comms.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; If anyone has any thoughts on this, I'd be interested.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you're using your protocol to effectively get remote control over
&lt;br&gt;&amp;gt; objects, have you considered writing something to support DRB[1] on the
&lt;br&gt;&amp;gt; server side? Otherwise you could also look at SLIM[2], which is the protocol
&lt;br&gt;&amp;gt; Fitnesse uses in much the same way as Cucumber uses the wire protocol. We
&lt;br&gt;&amp;gt; did consider using slim in Cucumber - it's widely supported with server
&lt;br&gt;&amp;gt; implementations on many platforms, but since SLIM has much more flexibility
&lt;br&gt;&amp;gt; that we needed, we decided to keep things simple.
&lt;/div&gt;&lt;br&gt;Thanks, Matt.
&lt;br&gt;[2] has some really good ideas and some that I've already thought of.
&lt;br&gt;I kinda like the multiple instructions per transaction. I don't know
&lt;br&gt;if I need that yet. I considered [1] but wasn't sure how easy it would
&lt;br&gt;be to write a server for DRb in another language.
&lt;br&gt;&lt;br&gt;All I'm doing is representing the Ruby object protocol (object.send
&lt;br&gt;:message, args) in REST.
&lt;br&gt;&lt;br&gt;JSON suffices for just about any object serialization and you can
&lt;br&gt;customize it for your class. I currently don't need to layer any
&lt;br&gt;command structure on top of JSON. Only the message's arguments payload
&lt;br&gt;and return values get serialized/deserialized. JSON is built-in or
&lt;br&gt;supported via a standard lib or module in all of my targeted
&lt;br&gt;languages. .Net/PHP/Perl and Python.
&lt;br&gt;&lt;br&gt;REST works to supply the basics of the command layer.
&lt;br&gt;&lt;br&gt;Resources are classes, objects and bare functions.
&lt;br&gt;&lt;br&gt;E.g. To create a new object from a class.
&lt;br&gt;obj=MyObject.new =&amp;gt; POST: &lt;a href=&quot;http://server/class/MyObject&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/class/MyObject&lt;/a&gt;&lt;br&gt;obj-MyObject.new(1,2) POST: &lt;a href=&quot;http://server/class/MyObject&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/class/MyObject&lt;/a&gt;&amp;nbsp; 'args=[1,2]'
&lt;br&gt;&lt;br&gt;These return an object id along with json_cerate args.
&lt;br&gt;&lt;br&gt;To call a method on said object:
&lt;br&gt;&lt;br&gt;obj.f(:a=&amp;gt;10) =&amp;gt; PUT : &lt;a href=&quot;http://server/object/1/msg/f&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/object/1/msg/f&lt;/a&gt;&amp;nbsp;'args={&amp;quot;a&amp;quot;:1,&amp;quot;b&amp;quot;:2}'
&lt;br&gt;.. and returning results as above.
&lt;br&gt;&lt;br&gt;To call a class level method, return a single object or a list of them, use GET.
&lt;br&gt;&lt;br&gt;obj=MyClass.get(1) =&amp;gt; GET &lt;a href=&quot;http://server/class/MyClass/msg/get?args=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/class/MyClass/msg/get?args=1&lt;/a&gt;&lt;br&gt;&amp;nbsp;-- raw method --
&lt;br&gt;obj =JSON.parse &amp;nbsp;GET &lt;a href=&quot;http://server/object/1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/object/1&lt;/a&gt;&lt;br&gt;&lt;br&gt;List (via a query):
&lt;br&gt;array = MyClass.query('where active = ?', true) =&amp;gt;
&lt;br&gt;&amp;nbsp; GET &lt;a href=&quot;http://server/class/MyClass/msg/query?'args=&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/class/MyClass/msg/query?'args=&lt;/a&gt;[&amp;quot;WHERE active =
&lt;br&gt;?&amp;quot;,true]' &amp;nbsp;# with URL encoding
&lt;br&gt;&lt;br&gt;-- raw list of all objects of a class --
&lt;br&gt;GET &lt;a href=&quot;http://server/class/MyClass/*&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/class/MyClass/*&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- raw list of all objects --
&lt;br&gt;GET &lt;a href=&quot;http://server/object/*&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/object/*&lt;/a&gt;&lt;br&gt;&lt;br&gt;... and so on
&lt;br&gt;&lt;br&gt;All returned objects on the Ruby side are just handles that only hold
&lt;br&gt;the id. They don't contain any marshaled data from the target language
&lt;br&gt;side. The reasoning is that all variable access must be done via
&lt;br&gt;accessor methods since that is the case in Ruby. However, given a REST
&lt;br&gt;call like this in a target server:
&lt;br&gt;PUT &lt;a href=&quot;http://server/object/2/msg/a&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/object/2/msg/a&lt;/a&gt;&lt;br&gt;the implementation is free to decide that that is a variable access,
&lt;br&gt;and assuming it is public, return its value. Setting the contents of a
&lt;br&gt;variable is just the same, but with Ruby conventions that the target
&lt;br&gt;language has to obey:
&lt;br&gt;&lt;br&gt;obj.a=1 &amp;nbsp;=&amp;gt; PUT &lt;a href=&quot;http://server/object/3/a=&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://server/object/3/a=&lt;/a&gt;&amp;nbsp; 'args=[1]'
&lt;br&gt;&lt;br&gt;The motivation behind this is to use both Cuke and RSpec to test
&lt;br&gt;legacy (or BDD develop new) projects w/o having to install and learn
&lt;br&gt;another BDD/xUnit framework.
&lt;br&gt;&lt;br&gt;I think this suffices for all RSpec use cases, but it may be
&lt;br&gt;incomplete. If you are anyone think of anything I have missed, let me
&lt;br&gt;know.
&lt;br&gt;&lt;br&gt;Already you can:
&lt;br&gt;&lt;br&gt;sudo gem install &amp;lt;sexy name goes here&amp;gt;
&lt;br&gt;(in ../spec_helper.rb: require '&amp;lt;sexy name&amp;gt;')
&lt;br&gt;&lt;br&gt;describe MyObject
&lt;br&gt;&amp;nbsp; before(:each)
&lt;br&gt;&amp;nbsp; &amp;nbsp; @obj = MyObject.new
&lt;br&gt;&amp;nbsp;end
&lt;br&gt;it &amp;quot;should be valid&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp;@obj.should be_valid &amp;nbsp;# &amp;nbsp;would PUT/ object/&amp;lt;id&amp;gt;msg/valid?
&lt;br&gt;end
&lt;br&gt;it &amp;quot;should have x == ['avg', 10.0]&amp;quot; do
&lt;br&gt;&amp;nbsp; @obj.x.should == ['avg', 10.0]
&lt;br&gt;end
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;Note there is no need to declare a class on the RSpec side, or to
&lt;br&gt;include a module or inherit from some other class. In PHP to get the
&lt;br&gt;specs to pass:
&lt;br&gt;--- my_object.php &amp;nbsp; -- &amp;nbsp;&amp;lt;a naming convention&amp;gt;
&lt;br&gt;class MyObject {
&lt;br&gt;&amp;nbsp; var x;
&lt;br&gt;&amp;nbsp; function MyObject() {x=array(&amp;quot;avg&amp;quot;, 10.0);}
&lt;br&gt;&amp;nbsp; function isValid() { return true; } // another convention
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&lt;br&gt;You get in to a R-G-R rhythm just as quickly as with native Ruby code.
&lt;br&gt;&lt;br&gt;The server code for this would need to reflect on MyObject to
&lt;br&gt;determine variable access and discover methods that start with 'isXXX'
&lt;br&gt;&lt;br&gt;Currently this is very primitive. There is no support for passing
&lt;br&gt;objects to other objects. I don't know about class level methods in
&lt;br&gt;all target languages yet. I thought the user could provide class
&lt;br&gt;factory classes for those if they don't exist, like in PHP4.
&lt;br&gt;&lt;br&gt;It requires an object store on the server side, each implementation is
&lt;br&gt;free to decide on that. In Sinatra I it is just a class variable for
&lt;br&gt;now, the object ids are the indexes.
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; Should we :
&lt;br&gt;&amp;gt;&amp;gt; o continue to use web proxies for objects and method calls?
&lt;br&gt;&amp;gt;&amp;gt; o -or- switch to running the matchers (should ==, etc.) over the wire
&lt;br&gt;&amp;gt;&amp;gt; protocol, more like cucumber?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm not really clear what the goal of your app is, but to go more into line
&lt;br&gt;&amp;gt; with what cucumber's doing, I think what you'd do would be to allow RSpec to
&lt;br&gt;&amp;gt; remotely invoke entire examples (&amp;quot;it blocks&amp;quot;) remotely. You could then write
&lt;br&gt;&amp;gt; those examples entirely in the native language.
&lt;br&gt;&lt;br&gt;I mentioned the goal above. Writing those examples in the target
&lt;br&gt;language is not what I had in mind. I only want &amp;nbsp;code in the actual
&lt;br&gt;SUT to be written in that SUT's language. You'd have to port ALL of
&lt;br&gt;RSpec's matchers there or use another framework's assertion lib. It'd
&lt;br&gt;be interesting but __way__ beyond the scope of what I am doing. Also,
&lt;br&gt;I am not sure what an it block would look like it it were sent over
&lt;br&gt;the wire. I imagine it queries the SUT wire server for any matching
&lt;br&gt;&amp;quot;it&amp;quot;s and any left over are just reported as unimplemented.
&lt;br&gt;&lt;br&gt;BTW, does Cuke's wire protocol allow for a mixture of Ruby side and
&lt;br&gt;SUT side step definitions?
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; BTW, anyone working on a Cuke4PHP?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; That's the first time I've heard anyone even suggest it :) I'd be happy to
&lt;br&gt;&amp;gt; collaborate with someone if they wanted some help with that.
&lt;br&gt;&lt;br&gt;I seriously need this. And am willing to help. Currently we are using
&lt;br&gt;Cuke+Webrat+Mechanize to test only the web facing surface of the app.
&lt;br&gt;But to get things like 'Given I have a user named &amp;quot;Ted&amp;quot; with password
&lt;br&gt;&amp;quot;Secret&amp;quot;' &amp;nbsp;to work and insert into the legacy DB is tricky. If that
&lt;br&gt;step could execute on the PHP side, life would be sweet!
&lt;br&gt;&lt;br&gt;AFAIK, there seems to be simple REST servers in at least .Net and PHP.
&lt;br&gt;Fitzgerald for PHP and just using IIS and writing handlers in .Net.
&lt;br&gt;&lt;br&gt;Ed
&lt;br&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [1]&lt;a href=&quot;http://segment7.net/projects/ruby/drb/introduction.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://segment7.net/projects/ruby/drb/introduction.html&lt;/a&gt;&lt;br&gt;&amp;gt; [2]&lt;a href=&quot;http://fitnesse.org/FitNesse.UserGuide.SliM&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://fitnesse.org/FitNesse.UserGuide.SliM&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;Ed Howland
&lt;br&gt;&lt;a href=&quot;http://greenprogrammer.wordpress.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://greenprogrammer.wordpress.com&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://twitter.com/ed_howland&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://twitter.com/ed_howland&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=26752491&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/RSpec-wire-protocol-Was%3ARe%3A-describe-%22RSpec%27s-documentation%22-do-tp26703150p26752491.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26748451</id>
	<title>Re: Stubbing calls to S3 from Paperclip</title>
	<published>2009-12-11T09:27:02Z</published>
	<updated>2009-12-11T09:27:02Z</updated>
	<author>
		<name>Andrei Erdoss</name>
	</author>
	<content type="html">Ok, I found something that works.&lt;br&gt;&lt;br&gt;@photo.stub!(:save_attached_files).and_return(true)&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Dec 11, 2009 at 5:32 PM, Andrei Erdoss &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26748451&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;erdoss@...&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;Any idea on how to stub calls to Amazon S3 from the Paperclip plugin?&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;Andrei Erdoss&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Andrei Erdoss&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=26748451&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/Stubbing-calls-to-S3-from-Paperclip-tp26746368p26748451.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26746368</id>
	<title>Stubbing calls to S3 from Paperclip</title>
	<published>2009-12-11T07:32:32Z</published>
	<updated>2009-12-11T07:32:32Z</updated>
	<author>
		<name>Andrei Erdoss</name>
	</author>
	<content type="html">Any idea on how to stub calls to Amazon S3 from the Paperclip plugin?&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;-- &lt;br&gt;Andrei Erdoss&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=26746368&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/Stubbing-calls-to-S3-from-Paperclip-tp26746368p26746368.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26744837</id>
	<title>Re: RSpec wire protocol Was:Re: describe &quot;RSpec's documentation&quot; do</title>
	<published>2009-12-11T06:03:44Z</published>
	<updated>2009-12-11T06:03:44Z</updated>
	<author>
		<name>Matt Wynne</name>
	</author>
	<content type="html">&lt;br&gt;On 9 Dec 2009, at 00:09, Ed Howland wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Matt,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I was facinated to read the email thread on Cuke's wire protoccol. &amp;nbsp;
&lt;br&gt;&amp;gt; You guys collaborated well.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have been working on my own to develop a similar protocol for &amp;nbsp;
&lt;br&gt;&amp;gt; RSpec. It is totally external to RSpec right now and very primitive.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Whereas with Cucumber, the step definitions are run on some other &amp;nbsp;
&lt;br&gt;&amp;gt; language's server, my protocol executes all the code in Ruby in the &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;quot;it&amp;quot; blocks and proxies objects and method calls to a server. &amp;nbsp; 
&lt;br&gt;&amp;gt; Currently the protocol is CGIish+XML. The current server is PHP but &amp;nbsp;
&lt;br&gt;&amp;gt; could be anything like .Net.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; In the next iteration, I plan to use REST+JSON sort of like CounchDB &amp;nbsp;
&lt;br&gt;&amp;gt; or CounchREST. With REST you get all the error checking/responses &amp;nbsp;
&lt;br&gt;&amp;gt; with all the simplicity of the existing HTTP protocol, My first &amp;nbsp;
&lt;br&gt;&amp;gt; version used ActiveResource but there are other REST clients for &amp;nbsp;
&lt;br&gt;&amp;gt; Ruby, And JSON you already know.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It seemed to me that part of your discussion revolved around &amp;nbsp;
&lt;br&gt;&amp;gt; encoding the protocol in JSON or externally. Did you consider REST. &amp;nbsp;
&lt;br&gt;&amp;gt; Did you reject it because of performance?
&lt;/div&gt;&lt;br&gt;Yes we did, briefly - probably before the discussion went online on &amp;nbsp;
&lt;br&gt;the lighthouse ticket. I think there were a couple of reasons why not &amp;nbsp;
&lt;br&gt;REST:
&lt;br&gt;(1) simplicity - we wanted the wire server to be as low-tech as &amp;nbsp;
&lt;br&gt;possible so it would be easy and lightweight to implement on any &amp;nbsp;
&lt;br&gt;platform (think Cuke4EmbeddedDevice). Everyone's got a TCP stack but &amp;nbsp;
&lt;br&gt;not everyone's got a simple web server like sinatra - I'm not even &amp;nbsp;
&lt;br&gt;sure there's an especially simple one for .NET
&lt;br&gt;(2) flexibility - as the protocol has emerged, it's become clear that &amp;nbsp;
&lt;br&gt;the relationship is pretty much client / server, but when we first &amp;nbsp;
&lt;br&gt;started we weren't sure how much chatter would need to go back &amp; &amp;nbsp;
&lt;br&gt;forth. Obviously a REST server can't start making requests back to a &amp;nbsp;
&lt;br&gt;client (unless that client also starts offering a web server), but if &amp;nbsp;
&lt;br&gt;you've got two peers talking over a socket you can have two-way comms.
&lt;br&gt;&lt;br&gt;&amp;gt; If anyone has any thoughts on this, I'd be interested.
&lt;br&gt;&lt;br&gt;If you're using your protocol to effectively get remote control over &amp;nbsp;
&lt;br&gt;objects, have you considered writing something to support DRB[1] on &amp;nbsp;
&lt;br&gt;the server side? Otherwise you could also look at SLIM[2], which is &amp;nbsp;
&lt;br&gt;the protocol Fitnesse uses in much the same way as Cucumber uses the &amp;nbsp;
&lt;br&gt;wire protocol. We did consider using slim in Cucumber - it's widely &amp;nbsp;
&lt;br&gt;supported with server implementations on many platforms, but since &amp;nbsp;
&lt;br&gt;SLIM has much more flexibility that we needed, we decided to keep &amp;nbsp;
&lt;br&gt;things simple.
&lt;br&gt;&lt;br&gt;&amp;gt; Should we :
&lt;br&gt;&amp;gt; o continue to use web proxies for objects and method calls?
&lt;br&gt;&amp;gt; o -or- switch to running the matchers (should ==, etc.) over the &amp;nbsp;
&lt;br&gt;&amp;gt; wire protocol, more like cucumber?
&lt;br&gt;&lt;br&gt;I'm not really clear what the goal of your app is, but to go more into &amp;nbsp;
&lt;br&gt;line with what cucumber's doing, I think what you'd do would be to &amp;nbsp;
&lt;br&gt;allow RSpec to remotely invoke entire examples (&amp;quot;it blocks&amp;quot;) remotely. &amp;nbsp;
&lt;br&gt;You could then write those examples entirely in the native language.
&lt;br&gt;&lt;br&gt;&amp;gt; Thanks and great work,
&lt;br&gt;&amp;gt; Ed
&lt;br&gt;&amp;gt; BTW, anyone working on a Cuke4PHP?
&lt;br&gt;&lt;br&gt;That's the first time I've heard anyone even suggest it :) I'd be &amp;nbsp;
&lt;br&gt;happy to collaborate with someone if they wanted some help with that.
&lt;br&gt;&lt;br&gt;[1]&lt;a href=&quot;http://segment7.net/projects/ruby/drb/introduction.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://segment7.net/projects/ruby/drb/introduction.html&lt;/a&gt;&lt;br&gt;[2]&lt;a href=&quot;http://fitnesse.org/FitNesse.UserGuide.SliM&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://fitnesse.org/FitNesse.UserGuide.SliM&lt;/a&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, Nov 9, 2009 at 5:03 PM, Matt Wynne &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26744837&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;matt@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On 6 Nov 2009, at 12:49, David Chelimsky wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; [3]&lt;a href=&quot;http://github.com/aslakhellesoy/cucumber/blob/master/features/wire_protocol.feature&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://github.com/aslakhellesoy/cucumber/blob/master/features/wire_protocol.feature&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm well behind this effort and would like to offer my help on the &amp;nbsp;
&lt;br&gt;&amp;gt; Cucumber end to make it possible to use the features to generate the &amp;nbsp;
&lt;br&gt;&amp;gt; user documentation - I think this would make a terrific use case for &amp;nbsp;
&lt;br&gt;&amp;gt; us to support.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; cheers,
&lt;br&gt;&amp;gt; Matt
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;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;&amp;gt; +447974 430184
&lt;br&gt;&amp;gt;
&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=26744837&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;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; Ed Howland
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://greenprogrammer.wordpress.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://greenprogrammer.wordpress.com&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;a href=&quot;http://twitter.com/ed_howland&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://twitter.com/ed_howland&lt;/a&gt;&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=26744837&amp;i=2&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;cheers,
&lt;br&gt;Matt
&lt;br&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;+447974 430184
&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=26744837&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/RSpec-wire-protocol-Was%3ARe%3A-describe-%22RSpec%27s-documentation%22-do-tp26703150p26744837.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26728289</id>
	<title>Re: Need Help with Specs failing when using ActionMailer</title>
	<published>2009-12-10T06:20:47Z</published>
	<updated>2009-12-10T06:20:47Z</updated>
	<author>
		<name>Brad-95</name>
	</author>
	<content type="html">Dave
&lt;br&gt;Thanks for looking at this. &amp;nbsp;I really appreciate it.
&lt;br&gt;&lt;br&gt;Here is the method being called:
&lt;br&gt;&lt;br&gt;144 &amp;nbsp;# Sign up a new user with a default role of USER and with a state
&lt;br&gt;of pending.
&lt;br&gt;145 &amp;nbsp;# The user must activate their account via e-mail before they can
&lt;br&gt;login
&lt;br&gt;146 &amp;nbsp;def self.create_from_signup(params = {} )
&lt;br&gt;147 &amp;nbsp; &amp;nbsp;user = new(params)
&lt;br&gt;148 &amp;nbsp; &amp;nbsp;if user.valid?
&lt;br&gt;149 &amp;nbsp; &amp;nbsp; &amp;nbsp;user.register!
&lt;br&gt;150 &amp;nbsp; &amp;nbsp; &amp;nbsp;UserNotifier.deliver_signup_notification(user)
&lt;br&gt;151 &amp;nbsp; &amp;nbsp;end
&lt;br&gt;152 &amp;nbsp; &amp;nbsp;return user
&lt;br&gt;153 &amp;nbsp;end
&lt;br&gt;&lt;br&gt;Line 150 is calling UserNotifier
&lt;br&gt;&lt;br&gt;class UserNotifier &amp;lt; ActionMailer::Base
&lt;br&gt;&amp;nbsp; def signup_notification(user)
&lt;br&gt;&amp;nbsp; &amp;nbsp; setup_email(user)
&lt;br&gt;&amp;nbsp; &amp;nbsp; @subject &amp;nbsp; &amp;nbsp;+= &amp;quot;#{user.login}, Please activate your new account&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; @body[:url] &amp;nbsp;= &amp;quot;&lt;a href=&quot;http://#&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://#&lt;/a&gt;{SITE_HOST}/activate/#
&lt;br&gt;{user.activation_code}&amp;quot;
&lt;br&gt;&amp;nbsp; end
&lt;br&gt;&lt;br&gt;&amp;nbsp; def password_reset_notification(user, newpassword)
&lt;br&gt;&amp;nbsp; &amp;nbsp; setup_email(user)
&lt;br&gt;&amp;nbsp; &amp;nbsp; @subject &amp;nbsp; &amp;nbsp;+= &amp;quot;#{user.login}, Account changes&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; @body[:password] &amp;nbsp;= newpassword
&lt;br&gt;&amp;nbsp; end
&lt;br&gt;&lt;br&gt;&amp;nbsp; protected
&lt;br&gt;&amp;nbsp; def setup_email(user)
&lt;br&gt;&amp;nbsp; &amp;nbsp; @recipients &amp;nbsp;= &amp;quot;#{user.email}&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; @from &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= &amp;nbsp;SITE
&lt;br&gt;&amp;nbsp; &amp;nbsp; @subject &amp;nbsp; &amp;nbsp; = &amp;quot;[CONFIRMATION] &amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; @sent_on &amp;nbsp; &amp;nbsp; = Time.now
&lt;br&gt;&amp;nbsp; &amp;nbsp; @body[:user] = user
&lt;br&gt;&amp;nbsp; end
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;Everything works well in the standalone model spec. &amp;nbsp;It's when I
&lt;br&gt;combine it with controller spec's that the problem occurs.
&lt;br&gt;&lt;br&gt;Brad
&lt;br&gt;&lt;br&gt;On Dec 10, 4:55 am, David Chelimsky &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728289&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;dchelim...@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, Dec 9, 2009 at 7:48 PM, Brad &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26728289&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;brad.fors...@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; No one was able to help me with the last post so I thought I would try
&lt;br&gt;&amp;gt; &amp;gt; again with more details.  I am having problems with specs that invoke
&lt;br&gt;&amp;gt; &amp;gt; the mailer.  My User model has a method that invokes a mailer as part
&lt;br&gt;&amp;gt; &amp;gt; of the create_from_signup method.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; First an example of the test that passes in my spec/models/user_spec
&lt;br&gt;&amp;gt; &amp;gt; when run in isolation (i.e. spec spec/models/user_spec.rb).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;    before do
&lt;br&gt;&amp;gt; &amp;gt;      UserNotifier.deliveries = []
&lt;br&gt;&amp;gt; &amp;gt;    end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;    it &amp;quot;should signup a valid user and send an activation e-mail&amp;quot; do
&lt;br&gt;&amp;gt; &amp;gt;      u = User.create_from_signup(params)
&lt;br&gt;&amp;gt; &amp;gt;      u.state.should == 'pending'
&lt;br&gt;&amp;gt; &amp;gt;      UserNotifier.should have(1).deliveries
&lt;br&gt;&amp;gt; &amp;gt;      mail = UserNotifier.deliveries.first
&lt;br&gt;&amp;gt; &amp;gt;      mail.to.should eql( [u.email] )
&lt;br&gt;&amp;gt; &amp;gt;      mail.subject.should eql( &amp;quot;#{u.login}, Please activate your new
&lt;br&gt;&amp;gt; &amp;gt; account&amp;quot; )
&lt;br&gt;&amp;gt; &amp;gt;    end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; The spec passes with no problems [ all green :) ]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; When I run this same spec within my entire suite (spec spec), it fails
&lt;br&gt;&amp;gt; &amp;gt; with the following backtrace
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; ArgumentError in 'User Signup - should signup a valid user and send an
&lt;br&gt;&amp;gt; &amp;gt; activation e-mail&amp;quot;
&lt;br&gt;&amp;gt; &amp;gt; wrong number of arguments (0 for 1)
&lt;br&gt;&amp;gt; &amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; &amp;gt; base.rb:551:in 'content_type'
&lt;br&gt;&amp;gt; &amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; &amp;gt; base.rb:551:in 'render_message'
&lt;br&gt;&amp;gt; &amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; &amp;gt; base.rb:493:in 'create!'
&lt;br&gt;&amp;gt; &amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; &amp;gt; base.rb:452:in 'initialize'
&lt;br&gt;&amp;gt; &amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; &amp;gt; base.rb:395:in 'new'
&lt;br&gt;&amp;gt; &amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; &amp;gt; base.rb:395:in 'method_missing'
&lt;br&gt;&amp;gt; &amp;gt; rails/app/models/user.rb:150:in 'create_from_signup'
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What's on line 150 in user.rb? Please post the entire method
&lt;br&gt;&amp;gt; surrounding that line.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I get this same error in my user controller tests, whether I run it
&lt;br&gt;&amp;gt; &amp;gt; standalone or within the suite.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Does anyone have any idea what could be causing this?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Thanks in advance
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Brad
&lt;br&gt;&amp;gt;
&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=26728289&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;rspec-us...@...&lt;/a&gt;://rubyforge.org/mailman/listinfo/rspec-users
&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=26728289&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/Need-Help-with-Specs-failing-when-using-ActionMailer-tp26720525p26728289.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26725376</id>
	<title>Re: Custom Matcher and Webrat methods</title>
	<published>2009-12-10T02:51:23Z</published>
	<updated>2009-12-10T02:51:23Z</updated>
	<author>
		<name>Rodrigo Rosenfeld Rosas</name>
	</author>
	<content type="html">Matt Wynne escreveu:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On 10 Dec 2009, at 00:53, Rodrigo Rosenfeld Rosas wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Matt Wynne escreveu:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ...
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; One problem less :) Next one to be solved: making Selenium work 
&lt;br&gt;&amp;gt;&amp;gt; faster with Webrat :)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You might want to look at replacing webrat with Capybara then. I've 
&lt;br&gt;&amp;gt; not tried it myself, but I understand Selenium2 (which Capybara 
&lt;br&gt;&amp;gt; supports) is much faster.
&lt;/div&gt;Thank you once again Matt. I wonder how you get updated by these new 
&lt;br&gt;gems... :)
&lt;br&gt;&lt;br&gt;I'll give Capybara a try. It seems well documented and also the Webrat 
&lt;br&gt;list is almost dead lately... Only a few questions and no answer lately...
&lt;br&gt;&lt;br&gt;Thank you for the suggestion.
&lt;br&gt;&lt;br&gt;Best Regards,
&lt;br&gt;&lt;br&gt;Rodrigo.
&lt;br&gt;&lt;br&gt;__________________________________________________
&lt;br&gt;Faça ligações para outros computadores com o novo Yahoo! Messenger 
&lt;br&gt;&lt;a href=&quot;http://br.beta.messenger.yahoo.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://br.beta.messenger.yahoo.com/&lt;/a&gt;&amp;nbsp;
&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=26725376&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/Custom-Matcher-and-Webrat-methods-tp26701762p26725376.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26724879</id>
	<title>Re: Custom Matcher and Webrat methods</title>
	<published>2009-12-10T02:14:20Z</published>
	<updated>2009-12-10T02:14:20Z</updated>
	<author>
		<name>Matt Wynne</name>
	</author>
	<content type="html">&lt;br&gt;On 10 Dec 2009, at 00:53, Rodrigo Rosenfeld Rosas wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Matt Wynne escreveu:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; On 8 Dec 2009, at 22:04, Rodrigo Rosenfeld Rosas wrote:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I would like to be able to write a custom matcher so that I could &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; call this test, for instance:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; @user.should be_allowed_to_visit(url)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; @non_welcome.should_not be_allowed_to_visit(url)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The matcher would call Webrat methods such as 'visit'.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; The problem is that it would try to call 'visit' from User class &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; instead of the binding in which @user access is verified...
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I have manually set the binding to the Matcher in a before(:all), &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; to avoid calling 'be_allowed_to_visit(url, binding)', but I would &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; like to know if there would be a better way to &amp;quot;get&amp;quot; this binding...
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Any thoughts on that?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; How have you defined the matcher? If you use the old-school &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; technique where you create a matcher class and a helper method to &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; construct the class (instead of using the shiny new matcher DSL) &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; then the method should execute in the context that can see the &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; binding, so you can pick it up and pass it into the matcher class &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; at that point.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Make sense?
&lt;br&gt;&amp;gt; Thank you, Matt, I have finally got it working. The trick is passing &amp;nbsp;
&lt;br&gt;&amp;gt; self to the initialize of the matcher class like:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; def be_allowed_to_visit(url)
&lt;br&gt;&amp;gt; BeAllowedToVisit.new(url, self) # def initialize(url, scope); &amp;nbsp;
&lt;br&gt;&amp;gt; scope.visit url...;end
&lt;br&gt;&amp;gt; end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; One problem less :) Next one to be solved: making Selenium work &amp;nbsp;
&lt;br&gt;&amp;gt; faster with Webrat :)
&lt;/div&gt;&lt;br&gt;You might want to look at replacing webrat with Capybara then. I've &amp;nbsp;
&lt;br&gt;not tried it myself, but I understand Selenium2 (which Capybara &amp;nbsp;
&lt;br&gt;supports) is much faster.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Rodrigo.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; __________________________________________________
&lt;br&gt;&amp;gt; Faça ligações para outros computadores com o novo Yahoo! Messenger &lt;a href=&quot;http://br.beta.messenger.yahoo.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://br.beta.messenger.yahoo.com/&lt;/a&gt;&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=26724879&amp;i=0&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;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=26724879&amp;i=1&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=26724879&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/Custom-Matcher-and-Webrat-methods-tp26701762p26724879.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26724800</id>
	<title>Re: Autospec is running the full suite too often</title>
	<published>2009-12-10T02:03:50Z</published>
	<updated>2009-12-10T02:03:50Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Wed, Dec 9, 2009 at 5:28 PM, DEfusion &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26724800&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;david.spurr@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; This is a problem I experience quite a bit:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; 1) Create a spec and outline all the examples (as not yet implemented)
&lt;br&gt;&amp;gt; 2) Write the body of a example
&lt;br&gt;&amp;gt; 3) Autospec runs spec -&amp;gt; fail
&lt;br&gt;&amp;gt; 4) Make that example pass
&lt;br&gt;&amp;gt; 5) Autospec runs spec -&amp;gt; pass
&lt;br&gt;&amp;gt; 6) Autospec then runs the entire test suite again
&lt;br&gt;&amp;gt; 7) Goto 2 (but now wait for entire suite to finish) before repeating
&lt;br&gt;&lt;br&gt;This is how autotest works by default. See the first paragraph of
&lt;br&gt;&lt;a href=&quot;http://zentest.rubyforge.org/ZenTest/Autotest.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://zentest.rubyforge.org/ZenTest/Autotest.html&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;&amp;gt; This is a little annoying especially when you get to the point of tens
&lt;br&gt;&amp;gt; of specs and hundreds of examples.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I seem to remember back when I was using Autotest you could limit how
&lt;br&gt;&amp;gt; often it re-runs the full test suite in these circumstances, but I've
&lt;br&gt;&amp;gt; not being able to find the options nor anything for Autospec.
&lt;br&gt;&lt;br&gt;Autospec is a simple wrapper for autotest that essentially sets an
&lt;br&gt;environment variable that lets RSpec know that it's in use so autotest
&lt;br&gt;loads the right autotest class. Beyond that, anything you can
&lt;br&gt;configure in a .autotest file will work with autospec.
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;David
&lt;br&gt;&lt;br&gt;&amp;gt; -D
&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=26724800&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/Autospec-is-running-the-full-suite-too-often-tp26719022p26724800.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26724622</id>
	<title>Re: Need Help with Specs failing when using ActionMailer</title>
	<published>2009-12-10T01:55:46Z</published>
	<updated>2009-12-10T01:55:46Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Wed, Dec 9, 2009 at 7:48 PM, Brad &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26724622&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;brad.forsyth@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; No one was able to help me with the last post so I thought I would try
&lt;br&gt;&amp;gt; again with more details.  I am having problems with specs that invoke
&lt;br&gt;&amp;gt; the mailer.  My User model has a method that invokes a mailer as part
&lt;br&gt;&amp;gt; of the create_from_signup method.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; First an example of the test that passes in my spec/models/user_spec
&lt;br&gt;&amp;gt; when run in isolation (i.e. spec spec/models/user_spec.rb).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    before do
&lt;br&gt;&amp;gt;      UserNotifier.deliveries = []
&lt;br&gt;&amp;gt;    end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;    it &amp;quot;should signup a valid user and send an activation e-mail&amp;quot; do
&lt;br&gt;&amp;gt;      u = User.create_from_signup(params)
&lt;br&gt;&amp;gt;      u.state.should == 'pending'
&lt;br&gt;&amp;gt;      UserNotifier.should have(1).deliveries
&lt;br&gt;&amp;gt;      mail = UserNotifier.deliveries.first
&lt;br&gt;&amp;gt;      mail.to.should eql( [u.email] )
&lt;br&gt;&amp;gt;      mail.subject.should eql( &amp;quot;#{u.login}, Please activate your new
&lt;br&gt;&amp;gt; account&amp;quot; )
&lt;br&gt;&amp;gt;    end
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The spec passes with no problems [ all green :) ]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; When I run this same spec within my entire suite (spec spec), it fails
&lt;br&gt;&amp;gt; with the following backtrace
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ArgumentError in 'User Signup - should signup a valid user and send an
&lt;br&gt;&amp;gt; activation e-mail&amp;quot;
&lt;br&gt;&amp;gt; wrong number of arguments (0 for 1)
&lt;br&gt;&amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; base.rb:551:in 'content_type'
&lt;br&gt;&amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; base.rb:551:in 'render_message'
&lt;br&gt;&amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; base.rb:493:in 'create!'
&lt;br&gt;&amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; base.rb:452:in 'initialize'
&lt;br&gt;&amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; base.rb:395:in 'new'
&lt;br&gt;&amp;gt; ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer/
&lt;br&gt;&amp;gt; base.rb:395:in 'method_missing'
&lt;br&gt;&amp;gt; rails/app/models/user.rb:150:in 'create_from_signup'
&lt;/div&gt;&lt;br&gt;What's on line 150 in user.rb? Please post the entire method
&lt;br&gt;surrounding that line.
&lt;br&gt;&lt;br&gt;&amp;gt; I get this same error in my user controller tests, whether I run it
&lt;br&gt;&amp;gt; standalone or within the suite.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Does anyone have any idea what could be causing this?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks in advance
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Brad
&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=26724622&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/Need-Help-with-Specs-failing-when-using-ActionMailer-tp26720525p26724622.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26724563</id>
	<title>Re: Problem with Before Filters</title>
	<published>2009-12-10T01:51:28Z</published>
	<updated>2009-12-10T01:51:28Z</updated>
	<author>
		<name>David Chelimsky-2</name>
	</author>
	<content type="html">On Thu, Dec 10, 2009 at 2:32 AM, Amit Kulkarni &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26724563&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lists@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; I am writing controller specs.I want to know how can i write specs which
&lt;br&gt;&amp;gt; invlove before filters in controllers.
&lt;br&gt;&lt;br&gt;Generally, before filters are part of the internal implementation and
&lt;br&gt;don't warrant specification that knows about their existence. For
&lt;br&gt;example, consider a controller action that should only be invoked by
&lt;br&gt;an admin. The spec might look like this:
&lt;br&gt;&lt;br&gt;describe WidgetController do
&lt;br&gt;&amp;nbsp; describe &amp;quot;POST create&amp;quot; do
&lt;br&gt;&amp;nbsp; &amp;nbsp; context &amp;quot;with an anonymous visitor&amp;quot; do
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; it &amp;quot;redirects to login&amp;quot; do
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; post :create, :widget =&amp;gt; valid_widget_attributes
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; response.should redirect_to(login_path)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end
&lt;br&gt;&amp;nbsp; &amp;nbsp; end
&lt;br&gt;&amp;nbsp; &amp;nbsp; context &amp;quot;with an 'admin'&amp;quot; do
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; it &amp;quot;redirects to the widget list&amp;quot; do
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; login_as :admin
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; post :create, :widget =&amp;gt; valid_widget_attributes
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; response.should redirect_to(widgets_path)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end
&lt;br&gt;&amp;nbsp; &amp;nbsp; end
&lt;br&gt;&amp;nbsp; end
&lt;br&gt;end
&lt;br&gt;&lt;br&gt;Typically this authorization would be implemented in a before filter,
&lt;br&gt;but, as you can see, there is no mention of before filters in the
&lt;br&gt;spec.
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;David
&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=26724563&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/Problem-with-Before-Filters-tp26723297p26724563.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26723297</id>
	<title>Problem with Before Filters</title>
	<published>2009-12-09T23:32:34Z</published>
	<updated>2009-12-09T23:32:34Z</updated>
	<author>
		<name>Roger Pack-5</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;I am writing controller specs.I want to know how can i write specs which
&lt;br&gt;invlove before filters in controllers.
&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=26723297&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/Problem-with-Before-Filters-tp26723297p26723297.html" />
</entry>

</feed>
