[rspec-users] RSpec 2 view specs: partial mocks

Michael Schuerig michael at schuerig.de
Sun Jun 20 18:59:41 EDT 2010


On Monday 21 June 2010, David Chelimsky wrote:
> On Jun 20, 2010, at 5:18 PM, Michael Schuerig wrote:
> > # in spec/spec_helpers.rb
> > 
> >  config.include PartialHelpers, :example_group => {
> >  
> >    :description => lambda { |description|
> >    :
> >      # FIXME this is a kludge as there is
> >      # currently (rspec 2.0.0.beta.12)
> >      # apparently no other way to identify a view
> >      # example group.
> >      description =~ /\.html\.erb$/
> >    
> >    }
> >  
> >  }
> 
> Here's how rspec-rails-2 does it:
> http://github.com/rspec/rspec-rails/blob/master/lib/rspec/rails/exam
> ple/view_example_group.rb#L106

Thanks, that's better.

Michael

-- 
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/


More information about the rspec-users mailing list