Matthijs Langenberg
2007-Nov-17 21:19 UTC
[rspec-users] Using RSpec to drive the design of a GUI desktop application
Hello everybody, I''ve been using RSpec as a tool to create web applications for some time now, in Rails, and using plain Ruby with WEBrick as well. The tool suits my needs and the story runner is great. Now there are things that aren''t solvable on the web, you''ll need a _real_ desktop application for those problems. So I''ve toyed a bit around with various GUI libraries as wxRuby and RubyCocoa, to get a feeling on how these libraries work and I love to create native OS X applications using cocoa. Of course, the next question that arose in my head was:"How do I drive the design of an application using a BDD framework like RSpec?". When writing a web application, it is relatively easy to simulate a HTTP request to the app and crawl through the returned HTML, but for a desktop application it''s different, right? The format (html) handled between the application, and the toolkit drawing the actual screen isn''t that open for a desktop application as it is for a web application. So, since we don''t want to test the inner workings of the gui toolkit and we only want to specify the behaviour of the code we write self, we must plug a framework somewhere, to capture the actual calls to this toolkit to know if our code is doing the right thing. At least, that''s how I see it currently. But how could that be done? Regards, Matthijs Langenberg -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071117/412ed0e7/attachment.html
M. Edward (Ed) Borasky
2007-Nov-17 21:51 UTC
[rspec-users] Using RSpec to drive the design of a GUI desktop application
Matthijs Langenberg wrote:> Hello everybody, > > I''ve been using RSpec as a tool to create web applications for some time > now, in Rails, and using plain Ruby with WEBrick as well. The tool suits > my needs and the story runner is great. > Now there are things that aren''t solvable on the web, you''ll need a > _real_ desktop application for those problems.Well ... given a large enough monitor and a minimal set of toolbars and menus on your browser, I''m not convinced there''s much of a difference between a "desktop" application and a "web" application from the point of view of a user sitting at a KVM portal. Of course, there is over a decade of convergence between the two user interfaces, so that''s not a great surprise. What do you think you couldn''t do with a browser and a web application framework/database running on the same machine as the browser and contacted via "localhost"?
Matthijs Langenberg
2007-Nov-18 00:48 UTC
[rspec-users] Using RSpec to drive the design of a GUI desktop application
Well that''s just cumbersome, and actually not the point of my discussion. I rather discuss about the ways we could use RSpec to create an application based on RubyCocoa (for example), instead of discussing about what types of software can''t work on the web, alright? On Nov 17, 2007 10:51 PM, M. Edward (Ed) Borasky <znmeb at cesmail.net> wrote:> Matthijs Langenberg wrote: > > Hello everybody, > > > > I''ve been using RSpec as a tool to create web applications for some time > > now, in Rails, and using plain Ruby with WEBrick as well. The tool suits > > my needs and the story runner is great. > > Now there are things that aren''t solvable on the web, you''ll need a > > _real_ desktop application for those problems. > > Well ... given a large enough monitor and a minimal set of toolbars and > menus on your browser, I''m not convinced there''s much of a difference > between a "desktop" application and a "web" application from the point > of view of a user sitting at a KVM portal. Of course, there is over a > decade of convergence between the two user interfaces, so that''s not a > great surprise. What do you think you couldn''t do with a browser and a > web application framework/database running on the same machine as the > browser and contacted via "localhost"? > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071118/0ca5ec38/attachment.html
Eloy Duran
2007-Nov-18 12:36 UTC
[rspec-users] Using RSpec to drive the design of a GUI desktop application
Hey Mathijs, Someone pinged me that you were interested in BDD with RubyCocoa (RC), so I thought I''d just chip in. I write my RC apps in a BDD way and as such support for it is included with Rucola. When we release 0.0.2 I will also release a screencast on how I use BDD with RC. But the bottom-line is, like with so many other BDD code, to make extensive use of mocking. Because most of the times you don''t want to test IF a NSTextField works, you just want to test the behaviour of your code IF a text field returns a specific value. This is easily done with mocking. Atm I don''t use rSpec but rather test/spec. So there are probably some hurdles to overcome if you really wish to use rSpec. Hope this helps. Cheers, Eloy Duran ==============================================================Hello everybody, I''ve been using RSpec as a tool to create web applications for some time now, in Rails, and using plain Ruby with WEBrick as well. The tool suits my needs and the story runner is great. Now there are things that aren''t solvable on the web, you''ll need a _real_ desktop application for those problems. So I''ve toyed a bit around with various GUI libraries as wxRuby and RubyCocoa, to get a feeling on how these libraries work and I love to create native OS X applications using cocoa. Of course, the next question that arose in my head was:"How do I drive the design of an application using a BDD framework like RSpec?". When writing a web application, it is relatively easy to simulate a HTTP request to the app and crawl through the returned HTML, but for a desktop application it''s different, right? The format (html) handled between the application, and the toolkit drawing the actual screen isn''t that open for a desktop application as it is for a web application. So, since we don''t want to test the inner workings of the gui toolkit and we only want to specify the behaviour of the code we write self, we must plug a framework somewhere, to capture the actual calls to this toolkit to know if our code is doing the right thing. At least, that''s how I see it currently. But how could that be done? Regards, Matthijs Langenberg
David Chelimsky
2007-Nov-18 14:56 UTC
[rspec-users] Using RSpec to drive the design of a GUI desktop application
On Nov 18, 2007 6:36 AM, Eloy Duran <eloy.de.enige at gmail.com> wrote:> Atm I don''t use rSpec but rather test/spec. > So there are probably some hurdles to overcome if you really wish to > use rSpec.What hurdles would you anticipate?
Chris McGrath
2007-Nov-18 15:45 UTC
[rspec-users] Using RSpec to drive the design of a GUI desktop application
On 18 Nov 2007, at 14:56, David Chelimsky wrote:> On Nov 18, 2007 6:36 AM, Eloy Duran <eloy.de.enige at gmail.com> wrote: >> Atm I don''t use rSpec but rather test/spec. >> So there are probably some hurdles to overcome if you really wish to >> use rSpec. > > What hurdles would you anticipate?I don''t think there are any insurmountable ones, we just need to make sure rucola is testing framework agnostic like merb. I''m going to have a go at integrating rspec tests later this evening as I want to use rspec with rubycocoa. Cheers, Chris
David Chelimsky
2007-Nov-18 16:19 UTC
[rspec-users] Using RSpec to drive the design of a GUI desktop application
On Nov 18, 2007 9:45 AM, Chris McGrath <chris at octopod.info> wrote:> > > On 18 Nov 2007, at 14:56, David Chelimsky wrote: > > > On Nov 18, 2007 6:36 AM, Eloy Duran <eloy.de.enige at gmail.com> wrote: > >> Atm I don''t use rSpec but rather test/spec. > >> So there are probably some hurdles to overcome if you really wish to > >> use rSpec. > > > > What hurdles would you anticipate? > > I don''t think there are any insurmountable ones, we just need to make > sure rucola is testing framework agnostic like merb. I''m going to have > a go at integrating rspec tests later this evening as I want to use > rspec with rubycocoa.Great! If you find anything that needs to change in rspec, please let us know. Obviously, patches are preferred as we''ve got a lot on our plates these days, but a bug report or feature request would be just as useful. Cheers, David> > Cheers, > > Chris > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Eloy Duran
2007-Nov-18 18:57 UTC
[rspec-users] Using RSpec to drive the design of a GUI desktop application
Yes sorry I meant that rucola isn''t fine tuned for rspec yet. :) But apperantly Chris is going to work on this. Eloy On 18-nov-2007, at 16:45, Chris McGrath <chris at octopod.info> wrote:> > On 18 Nov 2007, at 14:56, David Chelimsky wrote: > >> On Nov 18, 2007 6:36 AM, Eloy Duran <eloy.de.enige at gmail.com> wrote: >>> Atm I don''t use rSpec but rather test/spec. >>> So there are probably some hurdles to overcome if you really wish to >>> use rSpec. >> >> What hurdles would you anticipate? > > I don''t think there are any insurmountable ones, we just need to make > sure rucola is testing framework agnostic like merb. I''m going to have > a go at integrating rspec tests later this evening as I want to use > rspec with rubycocoa. > > Cheers, > > Chris > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users