[rspec-devel] Autotest + Rails + HEAD/trunk Rspec
David Chelimsky
dchelimsky at gmail.com
Fri Aug 10 07:58:47 EDT 2007
On 8/10/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
>
> David,
>
> I believe you authored the plugin for autotest integration (unless it
> was Aslak - my apologies then). Could you give me a hint on how
> Autotest ends up using the spec command in script/spec instead of the
> one installed in gems? Or is this a current bug?
When autotest starts it looks on the path for any file named
autotest/discover.rb. The one in rspec core tells autotest that if it
can find a spec directory that it must be rspec. It already knows that
if it finds config/environment that it must be rails (that's the
assumption made directly by autotest). It then adds words to a list:
rspec, rails, camping, etc - depending on what it learns from the
autotest/discover files and what it discovers.
So in the case of an rspec project, it then looks for a file named
autotest/rspec.rb, which it finds in rspec core. In the case of an
rspec/rails project it looks for a file named autotest/rails_rspec.rb,
which it finds in the rspec_on_rails plugin. These two different files
define two different spec commands. In fact, the one in trunk in core
now generates "ruby bin/spec" if it finds "bin/spec", otherwise it
generates "ruby spec" - that supports using autotest to work on rspec
directly.
That all make sense?
>
> I now have 100% code coverage w/ rspec's autotest, and will submit a
> patch soon.
>
> Scott
>
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>
More information about the rspec-devel
mailing list