[rspec-users] Help

Victor Asteinza vic at civrot.org
Tue Sep 16 21:55:04 EDT 2008



Sent from my iPhone.

On Sep 16, 2008, at 18:11, rspec-users-request at rubyforge.org wrote:

> Send rspec-users mailing list submissions to
>    rspec-users at rubyforge.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>    http://rubyforge.org/mailman/listinfo/rspec-users
> or, via email, send a message with subject or body 'help' to
>    rspec-users-request at rubyforge.org
>
> You can reach the person managing the list at
>    rspec-users-owner at rubyforge.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rspec-users digest..."
>
>
> Today's Topics:
>
>   1. Re: autospec is not picking latest changes (Luis Lavena)
>   2. Re: autospec is not picking latest changes (Mark Wilden)
>   3. Re: autospec is not picking latest changes (Luis Lavena)
>   4. Re: autospec is not picking latest changes (Mark Wilden)
>   5. Re: Cucumber - Ambiguous steps (Zach Dennis)
>   6. Re: RSpec story failing because create is not    rendering
>      'show' (Zach Dennis)
>   7. Re: autospec is not picking latest changes (Luis Lavena)
>   8. Re: Cucumber - stub! or mock? (Scott Taylor)
>   9. Re: Prepare for newbie-ness (Scott Taylor)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 16 Sep 2008 16:45:32 -0300
> From: "Luis Lavena" <luislavena at gmail.com>
> Subject: Re: [rspec-users] autospec is not picking latest changes
> To: rspec-users <rspec-users at rubyforge.org>
> Message-ID:
>    <71166b3b0809161245g6f80b8adg1fe33d8f56b54d2d at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Tue, Sep 16, 2008 at 4:41 PM, Matt Wynne <matt at mattwynne.net>  
> wrote:
>> try script/autospec instead - I always use that these days. not  
>> sure what
>> the difference is.
>
> Thank you for your feedback Matt,
>
> Tried both, the same result.
>
> The funny thing is that another Rails 2.1.1 application works without
> problems under the same scenario with both autotest and
> script/autospec.
>
> -- 
> Luis Lavena
> AREA 17
> -
> Human beings, who are almost unique in having the ability to learn  
> from
> the experience of others, are also remarkable for their apparent
> disinclination to do so.
> Douglas Adams
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 16 Sep 2008 13:22:38 -0700
> From: "Mark Wilden" <mark at mwilden.com>
> Subject: Re: [rspec-users] autospec is not picking latest changes
> To: rspec-users <rspec-users at rubyforge.org>
> Message-ID:
>    <3c30da400809161322m71305e9cgdbd30669faab2de5 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Tue, Sep 16, 2008 at 12:45 PM, Luis Lavena <luislavena at gmail.com>  
> wrote:
>
>>
>> The funny thing is that another Rails 2.1.1 application works without
>> problems under the same scenario with both autotest and
>> script/autospec.
>>
>
> That sounds like a plugin difference, then.
>
> ///ark
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080916/b911d613/attachment-0001.html 
> >
>
> ------------------------------
>
> Message: 3
> Date: Tue, 16 Sep 2008 17:45:25 -0300
> From: "Luis Lavena" <luislavena at gmail.com>
> Subject: Re: [rspec-users] autospec is not picking latest changes
> To: rspec-users <rspec-users at rubyforge.org>
> Message-ID:
>    <71166b3b0809161345r5284c1adt9f8f908cfb35b343 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Tue, Sep 16, 2008 at 5:22 PM, Mark Wilden <mark at mwilden.com> wrote:
>> On Tue, Sep 16, 2008 at 12:45 PM, Luis Lavena  
>> <luislavena at gmail.com> wrote:
>>>
>>> The funny thing is that another Rails 2.1.1 application works  
>>> without
>>> problems under the same scenario with both autotest and
>>> script/autospec.
>>
>> That sounds like a plugin difference, then.
>>
>
> Only two plugins installed: rspec and rspec-rails :-D
>
> -- 
> Luis Lavena
> AREA 17
> -
> Human beings, who are almost unique in having the ability to learn  
> from
> the experience of others, are also remarkable for their apparent
> disinclination to do so.
> Douglas Adams
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 16 Sep 2008 14:05:50 -0700
> From: "Mark Wilden" <mark at mwilden.com>
> Subject: Re: [rspec-users] autospec is not picking latest changes
> To: rspec-users <rspec-users at rubyforge.org>
> Message-ID:
>    <3c30da400809161405o57d7b668o29f11bca2d0df34b at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Tue, Sep 16, 2008 at 1:45 PM, Luis Lavena <luislavena at gmail.com>  
> wrote:
>
>>
>> Only two plugins installed: rspec and rspec-rails :-D
>>
>
> Sure - I was just suggesting you check that they were the same  
> versions in
> both projects. That would be one way the projects could behave  
> differently
> with autotest.
>
> ///ark
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080916/bacd6518/attachment-0001.html 
> >
>
> ------------------------------
>
> Message: 5
> Date: Tue, 16 Sep 2008 18:37:19 -0400
> From: "Zach Dennis" <zach.dennis at gmail.com>
> Subject: Re: [rspec-users] Cucumber - Ambiguous steps
> To: rspec-users <rspec-users at rubyforge.org>
> Message-ID:
>    <85d99afe0809161537j5f106efbs68f856042cbd3303 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Mon, Sep 15, 2008 at 9:34 AM, aslak hellesoy
> <aslak.hellesoy at gmail.com> wrote:
>> On Mon, Sep 15, 2008 at 3:27 PM, David Chelimsky <dchelimsky at gmail.com 
>> > wrote:
>>> On Mon, Sep 15, 2008 at 8:21 AM, David Chelimsky <dchelimsky at gmail.com 
>>> > wrote:
>>>> On Mon, Sep 15, 2008 at 8:13 AM, aslak hellesoy
>>>> <aslak.hellesoy at gmail.com> wrote:
>>>>> On Mon, Sep 15, 2008 at 3:07 PM, Joseph Wilk <lists at ruby- 
>>>>> forum.com> wrote:
>>>>>> David Chelimsky wrote:
>>>>>>> On Mon, Sep 15, 2008 at 3:54 AM, Joseph Wilk <lists at ruby-forum.com 
>>>>>>> >
>>>>>>> wrote:
>>>>>>>> You can still use non-regular expression steps in Cucumber:
>>>>>>>>
>>>>>>>> I've been unable to think of a good example where I would  
>>>>>>>> want only a
>>>>>>>> partial match of a step. Throwing away the unmatched  
>>>>>>>> characters. Does
>>>>>>>> anyone have good examples where they would?
>>>>>>>
>>>>>>> I think you've got this right and exposed a bug. Wanna report  
>>>>>>> it to
>>>>>>> lighthouse and/or fix it?
>>>>>>
>>>>>> Sure I'll report it and write a patch.
>>>>>>
>>>>>
>>>>> Hold on.
>>>>>
>>>>> If you want the regexp to match until the end of the string, why  
>>>>> don't
>>>>> you just stick a $ at the end of the Regexp?
>>>>>
>>>>> That's how regexen work. I don't see why they should work any
>>>>> differently when used in Cucumber.
>>>>
>>>> My previous comments withdrawn. I agree with Aslak.
>>>
>>> Although, I can see why one might be confused by this. I was. Even
>>> though these are regular expressions, the context led me to an
>>> (erroneous, but intuitive) expectation that in the presence of these
>>> two ...
>>>
>>> /this and "(.*)"/
>>> /this and "(.*)" and the other thing/
>>>
>>> ... that the first would not match "this and that and the other  
>>> thing"
>>>
>>> Perhaps a hint in the error message is in order?
>>>
>>>   When this and "that" and the other thing
>>>     Ambiguous step resolution for "this and \"that\" and the other  
>>> thing":
>>>
>>>     ./features//foo-steps.rb:4:in `/this and "(.*)" and the other  
>>> thing/'
>>>     ./features//foo-steps.rb:1:in `/this and  
>>> "(.*)"/' (Cucumber::Ambiguous)
>>>
>>>     Consider ending the shorter expression with a $
>>>
>>> WDYT?
>>>
>>
>> I like this much better. -Guiding people to use regexen properly is
>> better than redefining their semantics.
>>
>
> I completely agree. The current story runner fudges with regexps and
> it's really annoying. Raise the bar for regexp education... K-12. ;)
>
> -- 
> Zach Dennis
> http://www.continuousthinking.com
> http://www.mutuallyhuman.com
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 16 Sep 2008 18:43:03 -0400
> From: "Zach Dennis" <zach.dennis at gmail.com>
> Subject: Re: [rspec-users] RSpec story failing because create is not
>    rendering 'show'
> To: rspec-users at rubyforge.org
> Message-ID:
>    <85d99afe0809161543vcacbdd4x814c2fbf7452c91 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sat, Sep 13, 2008 at 2:24 PM, Damian Jones <lists at ruby-forum.com>  
> wrote:
>> Ok I got my story to pass by changing the follwing snippet
>>
>> When /I create a product named (.*) described with (.*)/ do |name,
>> description|
>> visits new_product_path
>> fills_in "product[name]", :with => name
>> fills_in "product[description]", :with => description
>> clicks_button "Create"
>> end
>>
>> don't know why it doesn't work with this:
>>
>> fills_in :name, :with => name
>>
>> Webrat api specs say it should
>
> No it doesn't. It says that the first argument is considered as an
> HTML id, name or label. The id is product_name. The name is
> product[name] and I can't tell from what you posted if you have a
> label "name".
>
> http://github.com/brynary/webrat/tree/master/lib/webrat/core/scope.rb
>
>
> Zach
>
>
> -- 
> Zach Dennis
> http://www.continuousthinking.com
> http://www.mutuallyhuman.com
>
>
> ------------------------------
>
> Message: 7
> Date: Tue, 16 Sep 2008 20:20:44 -0300
> From: "Luis Lavena" <luislavena at gmail.com>
> Subject: Re: [rspec-users] autospec is not picking latest changes
> To: rspec-users <rspec-users at rubyforge.org>
> Message-ID:
>    <71166b3b0809161620wa16bbb6pcd717a05b35b01c3 at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Tue, Sep 16, 2008 at 6:05 PM, Mark Wilden <mark at mwilden.com> wrote:
>> On Tue, Sep 16, 2008 at 1:45 PM, Luis Lavena <luislavena at gmail.com>  
>> wrote:
>>>
>>> Only two plugins installed: rspec and rspec-rails :-D
>>
>> Sure - I was just suggesting you check that they were the same  
>> versions in
>> both projects. That would be one way the projects could behave  
>> differently
>> with autotest.
>>
>
> Same version (using git and manually copied over).
>
> Also after the update my color output started act weird, but that
> another issue that I must investigate.
>
> -- 
> Luis Lavena
> AREA 17
> -
> Human beings, who are almost unique in having the ability to learn  
> from
> the experience of others, are also remarkable for their apparent
> disinclination to do so.
> Douglas Adams
>
>
> ------------------------------
>
> Message: 8
> Date: Tue, 16 Sep 2008 21:05:43 -0400
> From: Scott Taylor <mailing_lists at railsnewbie.com>
> Subject: Re: [rspec-users] Cucumber - stub! or mock?
> To: rspec-users <rspec-users at rubyforge.org>
> Message-ID: <389C7ACF-9F2D-43D7-83F0-63244E3CAE82 at railsnewbie.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
>
> On Sep 15, 2008, at 4:14 PM, Tim Glen wrote:
>
>> Hey all,
>>
>> I've got some code that I (mostly) inherited. It essentially has a
>> couple of AR class methods that look for a specific record by id:
>>
>> class Project < ActiveRecord::Base
>> class << self
>>   def specific_project
>>     @another_specific_project ||= Project.find(10) if
>> Project.exists?(10)
>>   end
>>
>>   def another_specific_project
>>     @specific_project ||= Project.find(11) if Project.exists?(11)
>>   end
>> end
>> end
>
>
> Why don't use just use a slug for these things? In other words - use a
> unique name for each record, since the numbers 10 and 11 don't mean
> much to anyone.
>
> Then, use a factory (like FixtureReplacement or Object Daddy) to
> generate the records in env.rb.  Here's how you'd do that with
> FixtureReplacement (at the bottom of your env.rb file):
>
> include FixtureReplacement
>
> create_project(:slug => "my-unique-name-for-project1")
> create_project(:slug => "my-unique-name-for-the-second-project")
>
> Scott
>
>
>
> ------------------------------
>
> Message: 9
> Date: Tue, 16 Sep 2008 21:11:30 -0400
> From: Scott Taylor <mailing_lists at railsnewbie.com>
> Subject: Re: [rspec-users] Prepare for newbie-ness
> To: rspec-users <rspec-users at rubyforge.org>
> Message-ID: <C8603100-934E-43CC-90AE-75FF5BA6DEA9 at railsnewbie.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
>
> On Sep 16, 2008, at 3:05 PM, David Chelimsky wrote:
>
>> On Tue, Sep 16, 2008 at 1:59 PM, Mark Wilden <mark at mwilden.com>  
>> wrote:
>>> On Tue, Sep 16, 2008 at 10:00 AM, Martin Streicher
>>> <martin.streicher at gmail.com> wrote:
>>>>
>>>> 3/ Has any documented how to run the debugger via rspec to help
>>>> track down
>>>> errors?
>>>
>>> We TDD/BDD/Agile practitioners aren't supposed to use a debugger,
>>
>> Please pay no attention to that sort of bullshit :)
>>
>> The idea is that TDD, practiced with discipline, should make you
>> depend less on a debugger. This is a good thing since debugging time
>> is impossible to estimate. But the idea that you're not supposed to
>> use a debugger is religious hog-wash.
>
> Yeah - I use a debugger all the time, often using the following
> snippets:
>
> I'll insert the following right inside the spec:
>
> it "should do something or other" do
>   $debug = true
>   some_method.should == some_value
> end
>
> Then in the implementation, I'll insert the following:
>
> def some_method
>   require "ruby-debug"; debugger if $debug
>   ...
> end
>
> This pops me right into the method.  It's very convenient.
>
> But regarding the previous comments, I'm surprised at how few actually
> use debuggers.  As long as you are writing specs for anything you'll
> be debugging, you should be fine.
>
> Just remember that unit testing started in smalltalk, which would
> *automatically* start a debugger when an example failed....
>
> Scott
>
>
>
> ------------------------------
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
> End of rspec-users Digest, Vol 27, Issue 52
> *******************************************


More information about the rspec-users mailing list