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 aslak.helle...@gmail.com 2009/3/30 Andrew Premdas

[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 action

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 joshuachish...@gmail.comwrote: 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

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 aslak.helle...@gmail.com: On Tue, Mar 31, 2009 at 11:34 AM, Josh Chisholm joshuachish...@gmail.com 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

[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

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

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 controllers, are

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 li...@ruby-forum.com 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

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 --

[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

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 li...@ruby-forum.com 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

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 m...@sabado.com 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

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

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread David Chelimsky
On Tue, Mar 31, 2009 at 11:08 AM, Fernando Perez li...@ruby-forum.com 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

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

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

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 zach.den...@gmail.com wrote: On Tue, Mar 31, 2009 at 5:39 AM, Fernando Perez li...@ruby-forum.com wrote: Fernando Perez wrote: Hi, Today is a big day. I officially transitioned from manually testing by clicking around in my app, to automated

[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

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/.

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 phlip2...@gmail.com 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

Re: [rspec-users] Expecting nil or false

2009-03-31 Thread David Chelimsky
On Tue, Mar 31, 2009 at 12:11 PM, Fernando Perez li...@ruby-forum.com 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

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

2009-03-31 Thread aidy lewis
Hi Phlip, On 31/03/2009, Phlip phlip2...@gmail.com 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

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

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 li...@ruby-forum.com 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

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

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] 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

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, we

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

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

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,

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 li...@ruby-forum.com 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

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] 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