[rspec-users] RSpec - Testing ActiveRecord addins

James Byrne lists at ruby-forum.com
Fri Jan 30 11:32:40 EST 2009


James Byrne wrote:

> 
> and when I run rake spec I see this:
> 
> NameError in 'Role should create a new instance given valid attributes'
> undefined local variable or method `logger' for 
> #<Spec::Rails::Example::ModelExampleGroup::Subclass_4:0x2ad081fa0998>
> /usr/lib64/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:471:in 
> `method_missing'
> /home/byrnejb/Software/Development/Projects/proforma.git/spec/spec_helper.rb:25:
> 
> Which is explicitly related to this code in spec_helper.rb:
> 
> # Custom Logger
> 
>   config.before(:each) do
>     full_example_description = "#{self.class.description} 
> #{@method_name}"
>     logger.info(
>       "\n\n#{full_example_description}\n#{'-' *
>           (full_example_description.length)}")
>   end
> 

If I comment out my own custom logger in environment.rb this error 
remains nonetheless.  I have not run spec before this in this project so 
I have no baseline to work from.

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list