Bug fix in the overriding of max_threads when it was nil

This commit is contained in:
Erwan
2012-09-04 18:29:54 +02:00
parent 8e5d506bc1
commit a21d844f13
2 changed files with 18 additions and 7 deletions

View File

@@ -94,7 +94,7 @@ describe Browser do
end
describe "#instance with :config_file = #{CONFIG_FILE_WITHOUT_PROXY}" do
it 'will check the instance vars' do
it "will check the instance vars" do
Browser.reset
check_instance_variables(
Browser.instance(:config_file => CONFIG_FILE_WITHOUT_PROXY),
@@ -104,7 +104,7 @@ describe Browser do
end
describe "#instance with :config_file = #{CONFIG_FILE_WITH_PROXY}" do
it 'will check the instance vars' do
it "will check the instance vars" do
Browser.reset
check_instance_variables(
Browser.instance(:config_file => CONFIG_FILE_WITH_PROXY),
@@ -113,16 +113,27 @@ describe Browser do
end
end
# => @todo Write something to test all possible overriding
describe "override option : user_agent" do
# TODO Write something to test all possible overriding
describe "override option : user_agent & threads" do
it "will check the instance vars, with an overriden one" do
Browser.reset
check_instance_variables(
Browser.instance(
:config_file => CONFIG_FILE_WITHOUT_PROXY,
:user_agent => 'fake IE'
:user_agent => "fake IE"
),
@json_config_without_proxy.merge('user_agent' => 'fake IE')
@json_config_without_proxy.merge("user_agent" => "fake IE")
)
end
it "should not override the max_threads if max_threads = nil" do
Browser.reset
check_instance_variables(
Browser.instance(
:config_file => CONFIG_FILE_WITHOUT_PROXY,
:max_threads => nil
),
@json_config_without_proxy
)
end
end