Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Matt Wynne
On 31 Mar 2009, at 18:19, David Chelimsky wrote: Autotest sucks. If we have too many tests, it runs them all, and this slows us down. Or, conversely, autotest is awesome if you take the time to learn how to use it: http://blog.davidchelimsky.net/2008/3/5/limiting-scope-of-autotest Th

Re: [rspec-users] Good introduction to rspec

2009-03-31 Thread Pablo L. de Miranda
Hi Sarah, I will take a look in the peepcode videos. Thank you, Pablo Lacerda de Miranda pablolmira...@gmail.com ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Good introduction to rspec

2009-03-31 Thread Sarah Gray
There are some great peepcode screencasts, if you like that kind of thing: http://peepcode.com/products/rspec-basics http://peepcode.com/products/rspec-mocks-and-models http://peepcode.com/products/rspec-controllers-and-tools Also the book is coming out it's in beta now, http://www.pragprog.com/t

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread David Chelimsky
On Tue, Mar 31, 2009 at 2:19 PM, Fernando Perez wrote: >> Please be careful when making absolute statements like this. First of >> all, even "just a bug reporting tool" adds tremendous value for the >> customer, because your catching bugs before they make it to >> production. > Value is what a cus

Re: [rspec-users] Good introduction to rspec

2009-03-31 Thread Pablo L. de Miranda
Hi Fernando, Are know, or have, some material ( tutorial, article, etc.. ) to recommend me? Att, Pablo Lacerda de Miranda Graduando Sistemas de Informação Universidade Estadual de Montes Claros pablolmira...@gmail.com ___ rspec-users mailing list rspec-

Re: [rspec-users] [Cucumber] Running single feature from command line

2009-03-31 Thread Mark Lynn
FYI: I did confirm the problem was the RSpec issue Aslak mentioned. I did not see a nice solution without messing around with the RSpec gem, and am I familiar enough with the RSpec code to patch it at this time. I ended up throwing a constant in my support/env.rb file and testing for this

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread David Chelimsky
On Tue, Mar 31, 2009 at 12:54 PM, Fernando Perez wrote: >> What is the full expression? i.e. what is it that should be false (or >> nil)? > > Basically: > > def is_it_cool? >  find(blabla, :conditions => 'coolness > 1000') > end > > In order to stay consistent and as the question mark suggests tha

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Fernando Perez
> Please be careful when making absolute statements like this. First of > all, even "just a bug reporting tool" adds tremendous value for the > customer, because your catching bugs before they make it to > production. Value is what a customer is something he is ready to pay more money for. Well, w

Re: [rspec-users] Good introduction to rspec

2009-03-31 Thread Fernando Perez
Pablo L. de Miranda wrote: > Hi guys, > Someone know some good introduction to rspec, I`m wanting to use Rspec > with > my Rails projects, but I don't found a good introduction. > >From my own experience: Write specs for your models and their class / instance methods. If you find yourself stru

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread Fernando Perez
> What is the full expression? i.e. what is it that should be false (or > nil)? Basically: def is_it_cool? find(blabla, :conditions => 'coolness > 1000') end In order to stay consistent and as the question mark suggests that true or false will be returned, I have updated my method too: def

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Phlip
David Chelimsky wrote: Or, conversely, autotest is awesome if you take the time to learn how to use it: http://blog.davidchelimsky.net/2008/3/5/limiting-scope-of-autotest Even with -f, after it ran our most recently changed test... ...it started the grand wazoo test batch. Pass! I can just

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Fernando Perez
> Or, conversely, autotest is awesome if you take the time to learn how to > use it: > > http://blog.davidchelimsky.net/2008/3/5/limiting-scope-of-autotest Well, I find it easier to simply type: $ rake spec Then depending on what failed I will from time to time run a single spec file: $ spec

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Zach Dennis
On Tue, Mar 31, 2009 at 5:39 AM, Fernando Perez wrote: > Fernando Perez wrote: >> Hi, >> >> Today is a big day. I officially transitioned from manually testing by >> clicking around in my app, to automated testing with RSpec + Autotest. > > 6 months since my initial post, what happened in between?

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Phlip
aidy lewis wrote: What editor are you then proposing? Or are you saying that all current editors lag behind XP practices? http://www.oreillynet.com/onlamp/blog/2008/05/dynamic_languages_vs_editors.html ___ rspec-users mailing list rspec-users@rubyfo

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread David Chelimsky
On Tue, Mar 31, 2009 at 4:39 AM, Fernando Perez wrote: > Fernando Perez wrote: >> Hi, >> >> Today is a big day. I officially transitioned from manually testing by >> clicking around in my app, to automated testing with RSpec + Autotest. > > 6 months since my initial post, what happened in between?

Re: [rspec-users] [Cucumber] Running single feature from command line

2009-03-31 Thread Mark Lynn
Aslak, Thanks! It is nice to at least know where the problem is. I am actually using Cucumber in a Merb project so the Rails solution does not help, but I will look for another workaround and post if I find something. Mark Lynn Sabado Technologies On Mar 31, 2009, at 11:56 AM, aslak h

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread aidy lewis
Hi Phlip, On 31/03/2009, Phlip wrote: > Our editor support for TDD also sucks. It should run the most recently > edited test cases, nearly automatically. Everyone swears by Textmate, and it > simply can't do that. Then, the Java-based editors also can't do it! What editor are you then proposing

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread David Chelimsky
On Tue, Mar 31, 2009 at 12:11 PM, Fernando Perez wrote: > >>> Do I have to rewrite my return values to always return true or false? >> No, but you may have to use different matchers. What are you using? > > I use: should be_false > > Rspec complains it receives nil when it is expecting false. As

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread David Chelimsky
On Tue, Mar 31, 2009 at 12:16 PM, Phlip wrote: > Fernando Perez wrote: > >> As a habit I like to abuse of the save button even if I only corrected >> some typos in comments, or changed the indentation. Suddenly autotest would >> kick in for nothing. > > Autotest sucks. If we have too many tests, i

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread Fernando Perez
>> Do I have to rewrite my return values to always return true or false? > No, but you may have to use different matchers. What are you using? I use: should be_false Rspec complains it receives nil when it is expecting false. -- Posted via http://www.ruby-forum.com/. ___

[rspec-users] Good introduction to rspec

2009-03-31 Thread Pablo L. de Miranda
Hi guys, Someone know some good introduction to rspec, I`m wanting to use Rspec with my Rails projects, but I don't found a good introduction. Att, Pablo Lacerda de Miranda pablolmira...@gmail.com ___ rspec-users mailing list rspec-users@rubyforge.org h

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Zach Dennis
On Tue, Mar 31, 2009 at 1:10 PM, Zach Dennis wrote: > On Tue, Mar 31, 2009 at 5:39 AM, Fernando Perez wrote: >> Fernando Perez wrote: >>> Hi, >>> >>> Today is a big day. I officially transitioned from manually testing by >>> clicking around in my app, to automated testing with RSpec + Autotest. >

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread Aslak Hellesøy
Den 31. mars. 2009 kl. 18.34 skrev "Colfer, Brian" : What about variable.nil? == true No, that will not raise anything. x.should == nil Or X.should be_nil Ditto for false and true. What have you been trying? Aslak Sent from Brian's iPhone On Mar 31, 2009, at 9:26 AM, "Fernando Perez"

Re: [rspec-users] [Cucumber] Running single feature from command line

2009-03-31 Thread Joseph Wilk
Mark Lynn wrote: When I use Aslak's version of Treetop as Joseph suggested, this does get rid of the polyglot error. However, I still get the following when running from the command line: $ cucumber -r features/steps -r features/support/env.rb features/plain/user_home_page.feature /Library/

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Phlip
Fernando Perez wrote: As a habit I like to abuse of the save button even if I only corrected some typos in comments, or changed the indentation. Suddenly autotest would kick in for nothing. Autotest sucks. If we have too many tests, it runs them all, and this slows us down. Our editor suppo

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread David Chelimsky
On Tue, Mar 31, 2009 at 11:08 AM, Fernando Perez wrote: > Hi, > > I just ran into this issue. I have a method that returns: false, true, > nil or an object. > > This method is used by another method to test for true/false. In Ruby > that's easy to handle as nil and false evaluate to false, and eve

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread Scott Taylor
On Mar 31, 2009, at 12:08 PM, Fernando Perez wrote: Hi, I just ran into this issue. I have a method that returns: false, true, nil or an object. This method is used by another method to test for true/false. In Ruby that's easy to handle as nil and false evaluate to false, and everything els

Re: [rspec-users] [Cucumber] Running single feature from command line

2009-03-31 Thread aslak hellesoy
On Tue, Mar 31, 2009 at 5:22 PM, Mark Lynn wrote: > > When I use Aslak's version of Treetop as Joseph suggested, this does get > rid of the polyglot error. However, I still get the following when running > from the command line: > > $ cucumber -r features/steps -r features/support/env.rb > featur

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread Colfer, Brian
What about variable.nil? == true Sent from Brian's iPhone On Mar 31, 2009, at 9:26 AM, "Fernando Perez" wrote: Hi, I just ran into this issue. I have a method that returns: false, true, nil or an object. This method is used by another method to test for true/false. In Ruby that's easy to

[rspec-users] Expecting nil or false

2009-03-31 Thread Fernando Perez
Hi, I just ran into this issue. I have a method that returns: false, true, nil or an object. This method is used by another method to test for true/false. In Ruby that's easy to handle as nil and false evaluate to false, and everything else evaluates to true, but RSpec seems to expect an exact va

Re: [rspec-users] [Cucumber] Running single feature from command line

2009-03-31 Thread Mark Lynn
When I use Aslak's version of Treetop as Joseph suggested, this does get rid of the polyglot error. However, I still get the following when running from the command line: $ cucumber -r features/steps -r features/support/env.rb features/plain/ user_home_page.feature /Library/Ruby/Site/1.8/r

Re: [rspec-users] [Cucumber] Running single feature from command line

2009-03-31 Thread Mark Lynn
Joseph, Thanks - treetop did get me past the previous error message. Now, I get $ cucumber -r features/support/env.rb -r features/support/plain.rb -r features/steps features/plain /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- feature

Re: [rspec-users] Getting the file a scenario is defined in (Cucumber)

2009-03-31 Thread aslak hellesoy
On Tue, Mar 31, 2009 at 2:06 PM, Kevin Olbrich wrote: > In Cucumber... > Is there a simple way to find out what file a scenario is defined in? > No, but there is a dirty way: Before do |scenario| f = scenario.instance_variable_get('@feature') if f puts f.file end end The scenario var

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Fernando Perez
> By "getting", do you mean new controllers arrive skinny? Or that you > have > refactored the same fat controllers, over time, until they are skinny? > > The latter is preferred, because we should not be writing the same sites > over > and over again. In theory! My good ole' fat pig controller

Re: [rspec-users] [Cucumber] Running single feature from command line

2009-03-31 Thread Joseph Wilk
Mark Lynn wrote: I am using Cucumber 0.2.3 and am having problems running a single feature. In particular, the cucumber Textmate bundle was not working so I traced it back and discovered that I could not run single files or features from the command line either. My setup has the following line

[rspec-users] Getting the file a scenario is defined in (Cucumber)

2009-03-31 Thread Kevin Olbrich
In Cucumber... Is there a simple way to find out what file a scenario is defined in? I'd like to use this information to load a set of fixtures depending on which feature is being run. So if I'm running the 'login.feature' file, I'd like to be able to load the set of fixtures under '/fixtures/log

[rspec-users] [Cucumber] Running single feature from command line

2009-03-31 Thread Mark Lynn
I am using Cucumber 0.2.3 and am having problems running a single feature. In particular, the cucumber Textmate bundle was not working so I traced it back and discovered that I could not run single files or features from the command line either. My setup has the following line in cucumber.y

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Phlip
Fernando Perez wrote: 6 months since my initial post, what happened in between? - My controllers are getting anorexic, and that's good. An action typically does only 1 call to a model and behind the scenes that model will make other calls to other models and do some fancy stuff, this used to

Re: [rspec-users] [Cucumber] World { nil } causes undefined method `exception=' in backtraces from steps called from other steps

2009-03-31 Thread Josh Chisholm
Great. Thanks! 2009/3/31 aslak hellesoy : > > > On Tue, Mar 31, 2009 at 11:34 AM, Josh Chisholm > wrote: >> >> We were using the following style of setting up a world: >> >> World do >>  def a_helper >>    ... >>  end >> end >> >> I don't know where I came up with that. I now realise we should ha

Re: [rspec-users] [Cucumber] World { nil } causes undefined method `exception=' in backtraces from steps called from other steps

2009-03-31 Thread aslak hellesoy
On Tue, Mar 31, 2009 at 11:34 AM, Josh Chisholm wrote: > We were using the following style of setting up a world: > > World do > def a_helper >... > end > end > > I don't know where I came up with that. I now realise we should have > been returning a world class here, but the above style see

[rspec-users] [Cucumber] World { nil } causes undefined method `exception=' in backtraces from steps called from other steps

2009-03-31 Thread Josh Chisholm
We were using the following style of setting up a world: World do def a_helper ... end end I don't know where I came up with that. I now realise we should have been returning a world class here, but the above style seems to be supported. Is it? Anyway, we got away with it so far. And it

Re: [rspec-users] RSpec makes me want to write better code

2009-03-31 Thread Fernando Perez
Fernando Perez wrote: > Hi, > > Today is a big day. I officially transitioned from manually testing by > clicking around in my app, to automated testing with RSpec + Autotest. 6 months since my initial post, what happened in between? - My controllers are getting anorexic, and that's good. An act

Re: [rspec-users] [Cucumber] Bug with background

2009-03-31 Thread Andrew Premdas
Submitted bug : https://rspec.lighthouseapp.com/projects/16211-cucumber/tickets/270-background-transactions-and-xx Put some features and output in a gist that show this bug, hope its sufficient. All best Andrew 2009/3/30 aslak hellesoy > > > 2009/3/30 Andrew Premdas > > Seem to be getting a