Hi guys I am using Aptana IDE How to do unit testing is there any sample explaining this I got some tutorial but that is not complete as i am a beginner Please guide me karthik.k -- Posted via http://www.ruby-forum.com/.
To start with read http://guides.rubyonrails.org/testing.html Sijo -- Posted via http://www.ruby-forum.com/.
Sijo Kg wrote:> To start with read > > http://guides.rubyonrails.org/testing.html > > > SijoHi sijo Thank you I need to ask one thing how to add data to database and check As i am new to ruby on rails i dont know how to do this karthik.k -- Posted via http://www.ruby-forum.com/.
> I need to ask one thing > how to add data to database and check >Hi You can use fixtures or the better Factories for this Read this http://thoughtbot.com/projects/factory_girl Sijo -- Posted via http://www.ruby-forum.com/.
Hi sijo Thank you Is there default testing technique or we need to install factory_girl because what ever i do i need to pass all information to my client So Is there default testing? -- Karthik.k Mobile - +91-9894991640 On Wed, Jul 22, 2009 at 1:53 PM, Sijo Kg <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > > I need to ask one thing > > how to add data to database and check > > > > Hi > > You can use fixtures or the better Factories for this > > Read this > http://thoughtbot.com/projects/factory_girl > Sijo > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 22, 12:54 am, Karthik Kantharaj <rails-mailing-l...@andreas- s.net> wrote:> Hi guys > > I am using Aptana IDE > > How to do unit testing is there any sample explaining this > > I got some tutorial but that is not complete as i am a beginner >I just went through this experience myself and I will tell you that there are many competing philosophies about testing, all of which use similar or identical terminology to mean or assume significantly different things. There is a vast overlap, but on a few crucial details there are vital differences whose apparent importance is magnified by the abysmal state of ones own ignorance. I found this to be exceptionally confusing in the beginning and the source of much misdirected effort on my part. For what it is worth I eventually settled on continuous integration testing for my Rails project. For this I use Cucumber, originally an offshoot of RSpec but now a completely distinct and independent package. The best places to start are the mailing lists devoted to testing. I can recommend both the RSpec and Cuke lists as places where extraordinarily knowledgeable and helpful people frequent. Both ML are replicated at and can be joined through groups.google.com (http:// groups.google.com/group/rspec and http://groups.google.com/group/cukes). There are also numerous self-help tutorials on the web. Just google (rails ruby testing tutorial). At my last count, Ryan Bates screencasts at railscast.com provided no fewer than ten episodes either directly about testing or having testing as a significant component of his presentation. Plus there is a treasure trove of other riches to be had at his site. Highly recommended. Recall to mind frequently that TDD/BDD is above all else a mental approach to computer systems development. The three rules that I have been taught are: Write no production code AT ALL until you have a failing test. Write only the minimal test that fails the current requirement, AND NO MORE. Write only enough production code to pass the test, AND NO MORE. It is hard to say which of these rules is the hardest to follow. In the beginning I suppose it has to be rule number one for most people. But after a time that becomes routine and the danger of not following rules two and three become evident. In truth, you must follow all three rules at all times. TDD/BDD just does not happen until you do. people call what they do TDD or BDD when they write tests, or specs or features or whatever; but if they do not rigorously follow the canon respecting what, when and how much code to write then they are really not. It just superficially appears that they are. The real test for yourself is the truthful answer to the question: Is what I am doing HARD? If the answer is no then you are missing something important (or are a savant). TDD and BDD is HARD. It is VERY HARD. Because you have to cast your every design intent as a programatically testable manifestation. That means you have to think very carefully about precisely what you NEED to accomplish and HOW to accomplish it, whereas most people spent most of the time thinking about what they WANT to accomplish. If you would like to see an excellent presentation on the grim realities of practicing TDD, this forms the core of a very discursive talk by Bob Martin given at RailsConf2009 entitled "What Killed Smalltalk Could Kill Ruby, Too", http://railsconf.blip.tv/file/2089545/. You have to get past the first five minutes or so which, as far as I could determine, have nothing to do with the subject of his presentation. His assistant however, is the author of Cucumber.
Hi Thank you for your response I gone through the links and your explanation but frankly speaking i understood but not fully I have one doubt unit testing (For model) what it does?(According to my knowledge) 1. It inserts in to database an temporary data from fixtures something.yml when i run rake test:units FunctionalTesting (For controller) what it does?(According to my knowledge) It checks if the controller is working correctly or not But when i run rake test:functionals i have one method called def test_should_create_post assert_difference(''Post.count'') do post :create, :post => {:title=>"my",:body=>"my body" } end but it is not adding to database please tell me 1. what unit test does 2. what functional test does -- Karthik.k Mobile - +91-9894991640 On Wed, Jul 22, 2009 at 7:55 PM, byrnejb <byrnejb-fqAF1SpE7daWxEb2tNKyrg@public.gmane.org> wrote:> > > > On Jul 22, 12:54 am, Karthik Kantharaj <rails-mailing-l...@andreas- > s.net> wrote: > > Hi guys > > > > I am using Aptana IDE > > > > How to do unit testing is there any sample explaining this > > > > I got some tutorial but that is not complete as i am a beginner > > > > I just went through this experience myself and I will tell you that > there are many competing philosophies about testing, all of which use > similar or identical terminology to mean or assume significantly > different things. There is a vast overlap, but on a few crucial > details there are vital differences whose apparent importance is > magnified by the abysmal state of ones own ignorance. I found this to > be exceptionally confusing in the beginning and the source of much > misdirected effort on my part. For what it is worth I eventually > settled on continuous integration testing for my Rails project. For > this I use Cucumber, originally an offshoot of RSpec but now a > completely distinct and independent package. > > The best places to start are the mailing lists devoted to testing. I > can recommend both the RSpec and Cuke lists as places where > extraordinarily knowledgeable and helpful people frequent. Both ML > are replicated at and can be joined through groups.google.com (http:// > groups.google.com/group/rspec and http://groups.google.com/group/cukes). > There are also numerous self-help tutorials on the web. Just google > (rails ruby testing tutorial). > > At my last count, Ryan Bates screencasts at railscast.com provided no > fewer than ten episodes either directly about testing or having > testing as a significant component of his presentation. Plus there > is a treasure trove of other riches to be had at his site. Highly > recommended. > > Recall to mind frequently that TDD/BDD is above all else a mental > approach to computer systems development. The three rules that I have > been taught are: > > Write no production code AT ALL until you have a failing test. > Write only the minimal test that fails the current requirement, AND NO > MORE. > Write only enough production code to pass the test, AND NO MORE. > > It is hard to say which of these rules is the hardest to follow. In > the beginning I suppose it has to be rule number one for most people. > But after a time that becomes routine and the danger of not following > rules two and three become evident. In truth, you must follow all > three rules at all times. TDD/BDD just does not happen until you do. > people call what they do TDD or BDD when they write tests, or specs or > features or whatever; but if they do not rigorously follow the canon > respecting what, when and how much code to write then they are really > not. It just superficially appears that they are. > > The real test for yourself is the truthful answer to the question: Is > what I am doing HARD? If the answer is no then you are missing > something important (or are a savant). TDD and BDD is HARD. It is > VERY HARD. Because you have to cast your every design intent as a > programatically testable manifestation. That means you have to think > very carefully about precisely what you NEED to accomplish and HOW to > accomplish it, whereas most people spent most of the time thinking > about what they WANT to accomplish. > > If you would like to see an excellent presentation on the grim > realities of practicing TDD, this forms the core of a very discursive > talk by Bob Martin given at RailsConf2009 entitled "What Killed > Smalltalk Could Kill Ruby, Too", http://railsconf.blip.tv/file/2089545/. > You have to get past the first five minutes or so which, as far as I > could determine, have nothing to do with the subject of his > presentation. His assistant however, is the author of Cucumber. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jonathan.dalton86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jul-23 12:27 UTC
Re: Help For Testing ruby on rails?
Where can I find a reliable, experienced Ruby proammer for helping me with an existing site built on Rails? Any thoughts Sent from my Verizon Wireless BlackBerry -----Original Message----- From: karthik k <cse.k.karthik@gmail.com> Date: Thu, 23 Jul 2009 17:12:35 To: <rubyonrails-talk@googlegroups.com> Subject: [Rails] Re: Help For Testing ruby on rails? Hi Thank you for your response I gone through the links and your explanation but frankly speaking i understood but not fully I have one doubt unit testing (For model) what it does?(According to my knowledge) 1. It inserts in to database an temporary data from fixtures something.yml when i run rake test:units FunctionalTesting (For controller) what it does?(According to my knowledge) It checks if the controller is working correctly or not But when i run rake test:functionals i have one method called def test_should_create_post assert_difference('Post.count') do post :create, :post => {:title=>"my",:body=>"my body" } end but it is not adding to database please tell me 1. what unit test does 2. what functional test does -- Karthik.k Mobile - +91-9894991640 On Wed, Jul 22, 2009 at 7:55 PM, byrnejb <byrnejb@harte-lyne.ca> wrote:> > > > On Jul 22, 12:54 am, Karthik Kantharaj <rails-mailing-l...@andreas- > s.net> wrote: > > Hi guys > > > > I am using Aptana IDE > > > > How to do unit testing is there any sample explaining this > > > > I got some tutorial but that is not complete as i am a beginner > > > > I just went through this experience myself and I will tell you that > there are many competing philosophies about testing, all of which use > similar or identical terminology to mean or assume significantly > different things. There is a vast overlap, but on a few crucial > details there are vital differences whose apparent importance is > magnified by the abysmal state of ones own ignorance. I found this to > be exceptionally confusing in the beginning and the source of much > misdirected effort on my part. For what it is worth I eventually > settled on continuous integration testing for my Rails project. For > this I use Cucumber, originally an offshoot of RSpec but now a > completely distinct and independent package. > > The best places to start are the mailing lists devoted to testing. I > can recommend both the RSpec and Cuke lists as places where > extraordinarily knowledgeable and helpful people frequent. Both ML > are replicated at and can be joined through groups.google.com (http:// > groups.google.com/group/rspec and http://groups.google.com/group/cukes). > There are also numerous self-help tutorials on the web. Just google > (rails ruby testing tutorial). > > At my last count, Ryan Bates screencasts at railscast.com provided no > fewer than ten episodes either directly about testing or having > testing as a significant component of his presentation. Plus there > is a treasure trove of other riches to be had at his site. Highly > recommended. > > Recall to mind frequently that TDD/BDD is above all else a mental > approach to computer systems development. The three rules that I have > been taught are: > > Write no production code AT ALL until you have a failing test. > Write only the minimal test that fails the current requirement, AND NO > MORE. > Write only enough production code to pass the test, AND NO MORE. > > It is hard to say which of these rules is the hardest to follow. In > the beginning I suppose it has to be rule number one for most people. > But after a time that becomes routine and the danger of not following > rules two and three become evident. In truth, you must follow all > three rules at all times. TDD/BDD just does not happen until you do. > people call what they do TDD or BDD when they write tests, or specs or > features or whatever; but if they do not rigorously follow the canon > respecting what, when and how much code to write then they are really > not. It just superficially appears that they are. > > The real test for yourself is the truthful answer to the question: Is > what I am doing HARD? If the answer is no then you are missing > something important (or are a savant). TDD and BDD is HARD. It is > VERY HARD. Because you have to cast your every design intent as a > programatically testable manifestation. That means you have to think > very carefully about precisely what you NEED to accomplish and HOW to > accomplish it, whereas most people spent most of the time thinking > about what they WANT to accomplish. > > If you would like to see an excellent presentation on the grim > realities of practicing TDD, this forms the core of a very discursive > talk by Bob Martin given at RailsConf2009 entitled "What Killed > Smalltalk Could Kill Ruby, Too", http://railsconf.blip.tv/file/2089545/. > You have to get past the first five minutes or so which, as far as I > could determine, have nothing to do with the subject of his > presentation. His assistant however, is the author of Cucumber. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
unknown wrote:> Where can I find a reliable, experienced Ruby proammer for helping me > with an existing site built on Rails? Any thoughtsYes. There are plenty on this list -- but don''t hijack an existing thread! Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
jonathan.dalton86-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2009-Jul-23 12:37 UTC
Re: Help For Testing ruby on rails?
No need to be rude. I thought I was swnding you a PM Sent from my Verizon Wireless BlackBerry -----Original Message----- From: Marnen Laibow-Koser <rails-mailing-list@andreas-s.net> Date: Thu, 23 Jul 2009 14:31:13 To: <rubyonrails-talk@googlegroups.com> Subject: [Rails] Re: Help For Testing ruby on rails? unknown wrote:> Where can I find a reliable, experienced Ruby proammer for helping me > with an existing site built on Rails? Any thoughtsYes. There are plenty on this list -- but don't hijack an existing thread! Best, -- Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
James Byrne wrote: [...]> > The real test for yourself is the truthful answer to the question: Is > what I am doing HARD? If the answer is no then you are missing > something important (or are a savant).I''m going to disagree *very* strongly with you here. TDD certainly takes discipline, and that may be hard at first. But once you do a little and pick up the pattern, it is exhilaratingly easy, at least for me. So, I would say to ask yourself: is what I am doing HARD? If the answer is yes, you have missed something. Learn the missing piece. Keep going until it becomes easy. If it is hard, you are working too hard and you need to stop and sharpen your saw. TDD and BDD is HARD. It is> VERY HARD. Because you have to cast your every design intent as a > programatically testable manifestation.Indeed.> That means you have to think > very carefully about precisely what you NEED to accomplish and HOW to > accomplish it,No! Your tests should generally test the result, not the implementation. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Hi Thank you for your response I gone through the links and your explanation but frankly speaking i understood but not fully I have one doubt unit testing (For model) what it does?(According to my knowledge) 1. It inserts in to database an temporary data from fixtures something.yml when i run rake test:units FunctionalTesting (For controller) what it does?(According to my knowledge) It checks if the controller is working correctly or not But when i run rake test:functionals i have one method called def test_should_create_post assert_difference(''Post.count'') do post :create, :post => {:title=>"my",:body=>"my body" } end but it is not adding to database please tell me 1. what unit test does 2. what functional test does -- Karthik.k Mobile - +91-9894991640 On Thu, Jul 23, 2009 at 6:08 PM, Marnen Laibow-Koser < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > James Byrne wrote: > [...] > > > > The real test for yourself is the truthful answer to the question: Is > > what I am doing HARD? If the answer is no then you are missing > > something important (or are a savant). > > I''m going to disagree *very* strongly with you here. TDD certainly > takes discipline, and that may be hard at first. But once you do a > little and pick up the pattern, it is exhilaratingly easy, at least for > me. > > So, I would say to ask yourself: is what I am doing HARD? If the answer > is yes, you have missed something. Learn the missing piece. Keep going > until it becomes easy. If it is hard, you are working too hard and you > need to stop and sharpen your saw. > > TDD and BDD is HARD. It is > > VERY HARD. Because you have to cast your every design intent as a > > programatically testable manifestation. > > Indeed. > > > That means you have to think > > very carefully about precisely what you NEED to accomplish and HOW to > > accomplish it, > > No! Your tests should generally test the result, not the > implementation. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---