[rspec-users] Autotest

Scott Taylor mailing_lists at railsnewbie.com
Wed Mar 28 21:51:51 EDT 2007


On Mar 28, 2007, at 9:26 PM, Michael Trier wrote:

>
> On Mar 28, 2007, at 8:54 PM, Scott Taylor wrote:
>
>>
>> What do you think about adding this code to rspec?  Or does it more
>> properly belong with autotest or as a plugin?
>>
>> I've noticed that it won't work with a) color and b) with a checked
>> out rspec directory w/ rails.  That means all of my describe it
>> spec's won't work, and the spec's won't even run.
>>
>> I've patched part b) for my own use.  Would this be helpful to  
>> anyone?
>
> I don't really follow you but if you want color just add:
>
> --colour
>
> to your spec.opts file.

Does that work for you?

I'm running rspec's trunk, so I have that checked out in vendor/rails.

One of the new features in trunk, which isn't present in the 0.8.2  
gem is using describe/it instead of context/specify.

I don't think the rspec_autotest even reads the options files.  Look  
at it's code:

class RspecAutotest < Autotest
   attr_accessor :spec_command
   def initialize # :nodoc:
     @spec_command = "spec --diff unified"
     super
     @exceptions = %r%^\./(?:coverage|doc)%
   end
	....
end

That means that unless you override the spec_command, it's not going  
to read from your spec.opts file.

This is what I get when I try to run the rake task:

euclid% rake spec:autotest
(in /Users/smtlaissezfaire/Sites/rails/dictionary)
spec --diff unified spec/models/definition_category_spec.rb spec/ 
helpers/terms_helper_spec.rb spec/models/definition_spec.rb spec/ 
models/user_term_spec.rb spec/models/user_spec.rb spec/controllers/ 
terms_controller_spec.rb spec/models/term_spec.rb spec/models/ 
category_spec.rb
/Users/smtlaissezfaire/Sites/rails/dictionary/vendor/plugins/ 
rspec_on_rails/lib/spec/rails/version.rb:14:  (RuntimeError)
######################################################################## 
####
Your RSpec on Rails plugin is incompatible with your installed RSpec.

RSpec          : 0.8.2 (r1560)
RSpec on Rails : r1652

Make sure your RSpec on Rails plugin is compatible with your RSpec gem.
See http://rspec.rubyforge.org/documentation/rails/install.html for  
details.
######################################################################## 
####

Notice that the command is "spec --diff ..." - without --options.   
That means the spec.opts isn't being used.

The version of rspec_on_rails I have checked out is the trunk  
version.  But the command is running against rspec gem which is older  
than trunk.  This is what I meant when I said "the specs won't even run"


Scott




>
> Michael
> railsconsulting.com
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list