[rspec-users] Migrating spec_helper with modifications

Chris Hoffman chris.c.hoffman at gmail.com
Mon Apr 30 15:28:17 EDT 2007


After moving into the HEAD of rspec, I am greeted with a mountain of errors,
which I expected, due to my specs not being migrated.

I use hpricot for a lot of my view tests, as it is extremely simple to
traverse the DOM with it.  I used to include HpricotSpecHelper in
spec_helper.rb, like so:

require 'hpricot_spec_helper'

module Spec
  module Rails
    module Runner
      class EvalContext < Test::Unit::TestCase
        include HpricotSpecHelper

However, I am now getting errors that indicate that this inclusion no longer
does what I want.  Is there a different class in which I should be including
this module?

The errors I'm getting are of the following type:

undefined method `elements' for #<#<Class:0xb6f12a14>:0xb6eb8ff0>

element(s) is a top-level method, so I would do things like the following:

element("p").inner_text.should == "Hello World"

The following link shows HpricotSpecHelper (with syntax highlighting):


Please let me know if I am not being clear with my difficulty.  Thanks for
the help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070430/3b6a376e/attachment.html 

More information about the rspec-users mailing list