[rspec-users] Migrating spec_helper with modifications
dchelimsky at gmail.com
Mon Apr 30 15:31:12 EDT 2007
On 4/30/07, Chris Hoffman <chris.c.hoffman at gmail.com> wrote:
> 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
> 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.
The easy way to include modules now is like this:
Spec::Runner.configure do |config|
That gets included in every behaviour.
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users