Hi there, I''m working on Ruby support for NetBeans, and we''re bundling RSpec (along with JRuby). One thing I''d really like to fix is having content assist (code completion / intellisense / code insight, it has many names) work inside your spec files such that you can not only hit ctrl-space and see "describe", "before", "it" etc. but also see the documentation for these methods. The problem is that when I''m looking at a spec file, there are no require-statements. Obviously, the methods I see called in the spec files must be defined by the test runner itself before running the spec file. Can somebody enlighten me as to what that context looks like? (As an example, in Ruby on Rails "view" files, I treat the file as if it''s extending ActionView::Base, so all the methods on that class (and included modules and such) all become available as methods you can call from the view. I was wondering if there was a similar class, or set of Modules, that I can use to simulate the context for the code inside the _spec.rb file.) -- Tor
On Sep 5, 2007, at 7:05 PM, Tor Norbye wrote:> > The problem is that when I''m looking at a spec file, there are no > require-statements. Obviously, the methods I see called in the spec > files must be defined by the test runner itself before running the > spec file. > > Can somebody enlighten me as to what that context looks like? > > (As an example, in Ruby on Rails "view" files, I treat the file as if > it''s extending ActionView::Base, so all the methods on that class > (and included modules and such) all become available as methods you > can call from the view. I was wondering if there was a similar class, > or set of Modules, that I can use to simulate the context for the > code inside the _spec.rb file.) >Hello Tor. At the top of my spec files is: require File.dirname(__FILE__) + ''/../spec_helper'' (At least in my Rails specs) bryanl http://smartic.us
On 9/5/07, Tor Norbye <tor.norbye at sun.com> wrote:> > I''m working on Ruby support for NetBeans, and we''re bundling RSpec > (along with JRuby).Would be pleased to try NB/Ruby again once the RSpec support is in there; any idea which milestone would contain this? -- Geoffrey Wiseman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070906/32a2f404/attachment.html
I''d like to try it too. I''d like an ide with half-decent ruby refactoring support. Geoffrey Wiseman wrote:> On 9/5/07, *Tor Norbye* <tor.norbye at sun.com > <mailto:tor.norbye at sun.com>> wrote: > > I''m working on Ruby support for NetBeans, and we''re bundling RSpec > (along with JRuby). > > > Would be pleased to try NB/Ruby again once the RSpec support is in > there; any idea which milestone would contain this? > > -- > Geoffrey Wiseman > ------------------------------------------------------------------------ > > _______________________________________________ > 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/20070907/77170800/attachment.html
On 9/5/07, Tor Norbye <tor.norbye at sun.com> wrote:> Hi there, > > I''m working on Ruby support for NetBeans, and we''re bundling RSpec > (along with JRuby). > > One thing I''d really like to fix is having content assist (code > completion / intellisense / code insight, it has many names) work > inside your spec files such that you can not only hit ctrl-space and > see "describe", "before", "it" etc. but also see the documentation > for these methods. > > The problem is that when I''m looking at a spec file, there are no > require-statements. Obviously, the methods I see called in the spec > files must be defined by the test runner itself before running the > spec file. > > Can somebody enlighten me as to what that context looks like? > > (As an example, in Ruby on Rails "view" files, I treat the file as if > it''s extending ActionView::Base, so all the methods on that class > (and included modules and such) all become available as methods you > can call from the view. I was wondering if there was a similar class, > or set of Modules, that I can use to simulate the context for the > code inside the _spec.rb file.)Hi Tor - we''re in the middle of a significant refactoring that is intended, in part, to make jobs like the one you are trying to do easier. I can tell you where to look right now, but it is subject to change over the next couple of weeks. To get an idea, the files you''re interested in are currently in /lib/spec/dsl and lib/spec/matchers. I''ll try to follow up as things settle down. Feel free to ask here if any specific questions come up. Cheers, David> > -- Tor > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >