Ensure setting mode as a string works too
This commit is contained in:
parent
00d0d7b438
commit
743d787164
|
@ -70,12 +70,12 @@ module Webrat
|
||||||
# Allows setting of webrat's mode, valid modes are:
|
# Allows setting of webrat's mode, valid modes are:
|
||||||
# :rails, :selenium, :rack, :sinatra, :mechanize, :merb
|
# :rails, :selenium, :rack, :sinatra, :mechanize, :merb
|
||||||
def mode=(mode)
|
def mode=(mode)
|
||||||
@mode = mode
|
@mode = mode.to_sym
|
||||||
|
|
||||||
# This is a temporary hack to support backwards compatibility
|
# This is a temporary hack to support backwards compatibility
|
||||||
# with Merb 1.0.8 until it's updated to use the new Webrat.configure
|
# with Merb 1.0.8 until it's updated to use the new Webrat.configure
|
||||||
# syntax
|
# syntax
|
||||||
if @mode.to_s == "merb"
|
if @mode == :merb
|
||||||
require("webrat/merb_session")
|
require("webrat/merb_session")
|
||||||
else
|
else
|
||||||
require("webrat/#{mode}")
|
require("webrat/#{mode}")
|
||||||
|
|
Loading…
Reference in New Issue