Trunk change: Must add a require for webrat to env.rb

1 view
Skip to first unread message

Bryan Helmkamp

unread,
Dec 1, 2008, 8:22:51 PM12/1/08
to web...@googlegroups.com
Hey all,

There's been a change to Webrat trunk which will likely require you
adding a line to your Cucumber env.rb if you are using Webrat with
Rails. Webrat no longer loads webrat/rails automatically when
installed as a plugin, and no longer loads webrat/rails automatically
if you "require 'webrat'" when RAILS_ENV is defined.

This change was made to cleanup Webrat loading now that Webrat can be
used in either Rails mode or Selenium mode for a Rails project. In
your env.rb file, make sure you have:

require "webrat/rails"

Also, if you want to use Webrat's new #contain, #have_selector and
#have_xpath RSpec matchers (recommended), you can add:

require "webrat/rspec-rails"

If you run into any issues with this, please let me know. Thanks.

Cheers,

-Bryan

--
Bryan Helmkamp
http://brynary.com -- My blog

Mike Gaffney

unread,
Dec 3, 2008, 2:51:27 PM12/3/08
to web...@googlegroups.com
Wouldn't somthing like:

Webrat.configure do |config|
config.mode = Webrat::Configuration::MODE_RAILS
end

or

config.mode = Webrat::Configuration::MODE_SELENIUM

and have that do the require be more flexible and self contained?

Bryan Helmkamp

unread,
Dec 6, 2008, 5:02:57 PM12/6/08
to webrat
Hmm... I like that. Good idea, Mike. I'll play around with that
approach this weekend.

Thanks,

-Bryan
Reply all
Reply to author
Forward
0 new messages