Better error message if Webrat mode is unknown

This commit is contained in:
Bryan Helmkamp 2008-12-28 14:24:24 -05:00
parent 61b864f113
commit f409ec3ecb
1 changed files with 11 additions and 1 deletions

View File

@ -24,7 +24,17 @@ module Webrat
when :mechanize when :mechanize
MechanizeSession MechanizeSession
else else
raise WebratError.new("Unknown Webrat mode: #{Webrat.configuration.mode.inspect}") raise WebratError.new(<<-STR)
Unknown Webrat mode: #{Webrat.configuration.mode.inspect}
Please ensure you have a Webrat configuration block that specifies a mode
in your test_helper.rb, spec_helper.rb, or env.rb (for Cucumber).
For example:
Webrat.configure do |config|
config.mode = :rails
end
STR
end end
end end