[rspec-users] can't get (r)spec to work in non-rails project

Ivo Dancet ivo.dancet at gmail.com
Sat Feb 16 08:51:06 EST 2008


Hi

I can't seem to get rspec and autotest to work in a small test  
project. The spec command doesn't load the implementation file. I  
found some info about non-rails projects with rspec, but these did not  
solve my problem.

I have the following files:

project_map/
	lib/todoist.rb
	spec/todoist_spec.rb

in todoist.rb I have a Todoist class, in the spec I have a describe  
Todoist with one example

Autotest runs and does reload files in /lib and /spec, it's the spec  
(spec spec/todoist_spec.rb) that crashes with 'uninitialized constant  
Todoist'.

Backtrace:
	./spec/todoist_spec.rb:3: uninitialized constant Todoist (NameError)
	from /Library/Ruby/Gems/1.8/gems/rspec-1.1.3/lib/spec/runner/ 
example_group_runner.rb:14:in `load'
	from /Library/Ruby/Gems/1.8/gems/rspec-1.1.3/lib/spec/runner/ 
example_group_runner.rb:14:in `load_files'
	from /Library/Ruby/Gems/1.8/gems/rspec-1.1.3/lib/spec/runner/ 
example_group_runner.rb:13:in `each'
	from /Library/Ruby/Gems/1.8/gems/rspec-1.1.3/lib/spec/runner/ 
example_group_runner.rb:13:in `load_files'
	from /Library/Ruby/Gems/1.8/gems/rspec-1.1.3/lib/spec/runner/ 
options.rb:84:in `run_examples'
	from /Library/Ruby/Gems/1.8/gems/rspec-1.1.3/lib/spec/runner/ 
command_line.rb:19:in `run'
	from /Library/Ruby/Gems/1.8/gems/rspec-1.1.3/bin/spec:4
	from /usr/bin/spec:16:in `load'
	from /usr/bin/spec:16

rspec 1.1.3 (run as gem)
standard Mac OS X Leopard ruby (1.8.6)

Any solutions?
Regards



More information about the rspec-users mailing list