Allow multiple configuration blocks without dropping previous configuration.
If you really want to start with a default configuration use: Webrat.configure(Webrat::Configuration.new) do |config| ... end
This commit is contained in:
parent
0b07dfedcd
commit
fdb94f399c
@ -4,7 +4,7 @@ module Webrat
|
|||||||
|
|
||||||
# Configures Webrat. If this is not done, Webrat will be created
|
# Configures Webrat. If this is not done, Webrat will be created
|
||||||
# with all of the default settings.
|
# with all of the default settings.
|
||||||
def self.configure(configuration = Webrat::Configuration.new)
|
def self.configure(configuration = Webrat.configuration)
|
||||||
yield configuration if block_given?
|
yield configuration if block_given?
|
||||||
@@configuration = configuration
|
@@configuration = configuration
|
||||||
end
|
end
|
||||||
|
@ -34,6 +34,20 @@ describe Webrat::Configuration do
|
|||||||
config.should_not open_error_files
|
config.should_not open_error_files
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should be configurable with multiple blocks" do
|
||||||
|
Webrat.configure do |config|
|
||||||
|
config.open_error_files = false
|
||||||
|
end
|
||||||
|
|
||||||
|
Webrat.configure do |config|
|
||||||
|
config.selenium_server_port = 1234
|
||||||
|
end
|
||||||
|
|
||||||
|
config = Webrat.configuration
|
||||||
|
config.should_not open_error_files
|
||||||
|
config.selenium_server_port.should == 1234
|
||||||
|
end
|
||||||
|
|
||||||
[:rails,
|
[:rails,
|
||||||
:selenium,
|
:selenium,
|
||||||
:rack,
|
:rack,
|
||||||
|
Loading…
Reference in New Issue
Block a user