Railsters: Here''s the two Facebook plugins we have so far: http://code.google.com/p/facebook-rails/ http://rfacebook.rubyforge.org/ Imagine my surprise when I discover that neither of them have unit tests! If I considered unit tests to be the number one criteria for productivity - way above trivial details like the quality or feature count of either of those plugins - then neither qualify. How do you build a complex app like a Facebook portal without unit tests? (That''s a rhetorical question, meaning please don''t try to answer it.) One of those plugins still embarrassingly has its generated default test case, test_this_plugin. Nobody replaced this with their real tests! Is there a Facebook plugin out there with unit tests? Or any other _sustainable_ fix for this situation? -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Or perhaps you could contribute to either project by submitting unit tests? Just a thought... Matt On 8/12/07, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Railsters: > > Here''s the two Facebook plugins we have so far: > > http://code.google.com/p/facebook-rails/ > http://rfacebook.rubyforge.org/ > > Imagine my surprise when I discover that neither of them have unit tests! > > If I considered unit tests to be the number one criteria for productivity - > way above trivial details like the quality or feature count of either of > those plugins - then neither qualify. How do you build a complex app like a > Facebook portal without unit tests? (That''s a rhetorical question, meaning > please don''t try to answer it.) > > One of those plugins still embarrassingly has its generated default test > case, test_this_plugin. Nobody replaced this with their real tests! > > Is there a Facebook plugin out there with unit tests? Or any other > _sustainable_ fix for this situation? > > -- > Phlip > http://www.oreilly.com/catalog/9780596510657/ > "Test Driven Ajax (on Rails)" > assert_xpath, assert_javascript, & assert_ajax > > > > >-- Matt White ----------------------- Thermal Creative http://blog.thermalcreative.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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Railsters: > > Here''s the two Facebook plugins we have so far: > > http://code.google.com/p/facebook-rails/ > http://rfacebook.rubyforge.org/ > > Imagine my surprise when I discover that neither of them have unit tests! > > If I considered unit tests to be the number one criteria for productivity - > way above trivial details like the quality or feature count of either of > those plugins - then neither qualify. How do you build a complex app like a > Facebook portal without unit tests? (That''s a rhetorical question, meaning > please don''t try to answer it.) > > One of those plugins still embarrassingly has its generated default test > case, test_this_plugin. Nobody replaced this with their real tests! > > Is there a Facebook plugin out there with unit tests? Or any other > _sustainable_ fix for this situation? > >I''m nearly finished with a lightweight facebook library (doesn''t include desktop stuff). It has a full test suite. I did it because I needed it for Autopendium, and wasn''t happy with including a plugin or gem that didn''t have any test on a live production site. Should be done within the next 48 hours (just have a little bit more to do, and then want to build a mini fb app with it to test it out. If you need anything before then, email me and I''ll send you what I''ve got. Cheers Chris -- ---------------------------- Autopendium :: Stuff about old cars http://autopendium.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 -~----------~----~----~----~------~----~------~--~---
Thanks for your response - I''m digesting it. Until then, a little joke...> Autopendium :: Stuff about old cars > http://autopendium.comI have a 1949 Studebaker. Of course, I had to replace the engine and tires. And I replaced the chassis and seats. But it occupies the same space! -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Thanks for your response - I''m digesting it. Until then, a little joke... > > >> Autopendium :: Stuff about old cars >> http://autopendium.com >> > > I have a 1949 Studebaker. > > Of course, I had to replace the engine and tires. > > And I replaced the chassis and seats. > > But it occupies the same space! > >Like it! Chris p.s. About to call it a day -- 1.35pm UK time, but will be back at work on the library tomorrow am. Will update with progress sometime tomorrow. All seems to be going quite smoothly ... so far -- ---------------------------- Autopendium :: Stuff about old cars http://autopendium.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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Railsters: > > Here''s the two Facebook plugins we have so far: > > http://code.google.com/p/facebook-rails/ > http://rfacebook.rubyforge.org/ > > Imagine my surprise when I discover that neither of them have unit tests! > > If I considered unit tests to be the number one criteria for productivity - > way above trivial details like the quality or feature count of either of > those plugins - then neither qualify. How do you build a complex app like a > Facebook portal without unit tests? (That''s a rhetorical question, meaning > please don''t try to answer it.) > > One of those plugins still embarrassingly has its generated default test > case, test_this_plugin. Nobody replaced this with their real tests! > > Is there a Facebook plugin out there with unit tests? Or any other > _sustainable_ fix for this situation? > >Phlip Just to let you know, I''ve pasted my Facebook library (with tests). Details are here: http://pushrod.wordpress.com/2007/08/14/rails-ruby-facebook-and-tests-my-own-itch-scratched/ Haven''t plugin-ized it yet, and am still working on my FB app, so it may well change as the app develops and has greater requirements. However, it''s got nearly all of the php lib''s functionality (the main part missing is storing the fb object in a cookie), got a good number of tests (in fact they were written first), and is working for me. But I''d welcome some feedback (it''s the first such thing I''ve written). Cheers Chris -- ---------------------------- Autopendium :: Stuff about old cars http://autopendium.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 -~----------~----~----~----~------~----~------~--~---
Chris T wrote:> Just to let you know, I''ve pasted my Facebook library (with tests). > Details are here: > > http://pushrod.wordpress.com/2007/08/14/rails-ruby-facebook-and-tests-my-own-itch-scratched/Allow me to catch up - is this rFacebook, the existing plugin? or is it your new Facebook plugin _and_ its unit tests? Don''t blame me for counting the latter against you - the plugin market is so agile that the good ideas tend to conglomerate towards the market leaders faster than the fair competition can catch up... -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Chris T wrote: > > >> Just to let you know, I''ve pasted my Facebook library (with tests). >> Details are here: >> >> http://pushrod.wordpress.com/2007/08/14/rails-ruby-facebook-and-tests-my-own-itch-scratched/ >> > > Allow me to catch up - is this rFacebook, the existing plugin? or is it your > new Facebook plugin _and_ its unit tests? > > Don''t blame me for counting the latter against you - the plugin market is so > agile that the good ideas tend to conglomerate towards the market leaders > faster than the fair competition can catch up... > >No, it''s nothing to do with rFacebook. I couldn''t get my head around that, and so it seemed simpler to write my own code based on the tests. I looked at the the various elements of the Facebook php lib and tried to understand the behaviour, then wrote tests for that behaviour, then wrote the code. By the way, it''s not yet a plugin -- just a lib that you put in, er, /lib, and then you include the ControllerUtilities. However, it should be a very simple job to turn it into a plugin if there''s any demand for it. Primarily I wrote it to satisfy Autopendium''s need for a Facebook library (with tests), and the lib approach worked fine for that. I''ll try and write another post later on today with a walkthrough of usage, but if you have any comments on the tests or code in the meantime... Cheers Chris -- ---------------------------- Autopendium :: Stuff about old cars http://autopendium.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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Chris T wrote: > > >> Just to let you know, I''ve pasted my Facebook library (with tests). >> Details are here: >> >> http://pushrod.wordpress.com/2007/08/14/rails-ruby-facebook-and-tests-my-own-itch-scratched/ >> > > Allow me to catch up - is this rFacebook, the existing plugin? or is it your > new Facebook plugin _and_ its unit tests? > > Don''t blame me for counting the latter against you - the plugin market is so > agile that the good ideas tend to conglomerate towards the market leaders > faster than the fair competition can catch up... > >I''ve just posted a short intro to the library, including a bit about the Facebook request/response cycle. Even if you don''t use the library (comments welcome, obviously), it should help you understand about the mythical Facebook object, and how it works. http://pushrod.wordpress.com/2007/08/15/the-how-and-why-of-my-streamlined-rails-facebook-library/ Cheers Chris -- ---------------------------- Autopendium :: Stuff about old cars http://autopendium.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 -~----------~----~----~----~------~----~------~--~---
> http://pushrod.wordpress.com/2007/08/14/rails-ruby-facebook-and-tests-my-own-itch-scratched/To the cries of collaborative competition from your blog commenters I add: I don''t need unit tests saying rFacebook does its thing. The burden of their absence rests upon its maintainers. I need a system to unit test my website''s connection to Facebook. All entrants in the Great Rails Facebook Plugin Race need that, so we can run our tests without molesting the real Facebook. -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:>> http://pushrod.wordpress.com/2007/08/14/rails-ruby-facebook-and-tests-my-own-itch-scratched/ >> > > To the cries of collaborative competition from your blog commenters I add: > > I don''t need unit tests saying rFacebook does its thing. The burden of their > absence rests upon its maintainers. I need a system to unit test my > website''s connection to Facebook. > > All entrants in the Great Rails Facebook Plugin Race need that, so we can > run our tests without molesting the real Facebook. > >So how does my (little) library stack up against that yardstick... -- ---------------------------- Autopendium :: Stuff about old cars http://autopendium.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 -~----------~----~----~----~------~----~------~--~---
> So how does my (little) library stack up against that yardstick...I don''t know. When I read the _top_ of the test suite, it seemed to concern itself with causing your Facebook interface to exist. So you are probably going to claim I need to read to the _bottom_ of that file now. Jeeze good free help is hard to find! (-; -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:>> So how does my (little) library stack up against that yardstick... >> > > I don''t know. When I read the _top_ of the test suite, it seemed to concern > itself with causing your Facebook interface to exist. > > So you are probably going to claim I need to read to the _bottom_ of that > file now. Jeeze good free help is hard to find! (-; > >My tests are very much written as part of the process of defining the behaviour. Not sure whether that''s The Right Way, it''s just how I do it, and It Works For Me. So I wrote a failing test which tries to instantiate a member of the Facebook class *before* I''d written the Facebook class (hence, it''s the first test in the file). Note, it doesn''t assume at that point that the class provides an interface with Facebook''s API, nor does it at any point make a call to the Facebook interface (so you can so we can "run your tests without molesting the real Facebook". In fact, there''s even a test (line 225) to confirm that it doesn''t :-) Not requiring you of course to read down to even the middle of the file -- wrote the code for my own needs, and thought it might be useful to others. I''m not trying, however, to be an "entrant in the Great Rails Facebook Plugin Race." Life''s too short, and there''s much better things to do. Cheers Chris -- ---------------------------- Autopendium :: Stuff about old cars http://autopendium.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 -~----------~----~----~----~------~----~------~--~---
Chris T wrote:> Note, it doesn''t assume at that point that the class provides an > interface with Facebook''s API, nor does it at any point make a call to > the Facebook interface (so you can so we can "run your tests without > molesting the real Facebook". In fact, there''s even a test (line 225) > to confirm that it doesn''t :-)Right; but so far neither your plugin nor rFacebook explicitly says "write your site using these test facilities". By comparison, Rails comes with goodies like the FunctionalTestCase, which gives us get :index, to test a web page with a ready-made system that matches what a real server would do. These systems are distinct from Rails''s internal unit tests...> Not requiring you of course to read down to even the middle of the file > -- wrote the code for my own needs, and thought it might be useful to > others. I''m not trying, however, to be an "entrant in the Great Rails > Facebook Plugin Race." Life''s too short, and there''s much better things > to do.Thus speaks the true entrant in the GRFPR! -- Phlip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Chris T wrote: > > >> Note, it doesn''t assume at that point that the class provides an >> interface with Facebook''s API, nor does it at any point make a call to >> the Facebook interface (so you can so we can "run your tests without >> molesting the real Facebook". In fact, there''s even a test (line 225) >> to confirm that it doesn''t :-) >> > > Right; but so far neither your plugin nor rFacebook explicitly says "write > your site using these test facilities". > > By comparison, Rails comes with goodies like the FunctionalTestCase, which > gives us get :index, to test a web page with a ready-made system that > matches what a real server would do. These systems are distinct from Rails''s > internal unit tests... > >Hmm. Not sure it''s up to the library writer (NB it''s not a plugin -- just a simple streamlined library that can easily be dropped in to the /lib folder) to provide tests above and beyond those for the library itslef. I don''t see such tests in other plugins, even those with extensive suites. Also I guess it would assume that the user is using the same test framework as the library writer (RSpec or Test::Unit or something else). Finally, it is Super Simple to look at the test code and see how to use it in your own code -- there''s even a DummyController and DummyControllerTest defined to allow the ControllerUtilities module to be tested. And if that doesn''t point the way, I don''t know what does. Of course, if that doesn''t work for you, you can always do what I did and Roll Your Own.>> Not requiring you of course to read down to even the middle of the file >> -- wrote the code for my own needs, and thought it might be useful to >> others. I''m not trying, however, to be an "entrant in the Great Rails >> Facebook Plugin Race." Life''s too short, and there''s much better things >> to do. >> > > Thus speaks the true entrant in the GRFPR! > >-- ---------------------------- Autopendium :: Stuff about old cars http://autopendium.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 -~----------~----~----~----~------~----~------~--~---