[rspec-users] Content assist for spec files
dchelimsky at gmail.com
Mon Sep 10 23:17:46 EDT 2007
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.
> -- Tor
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users