Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/rb/spec/unit/selenium/webdriver/remote/http/curb_spec.rb
1990 views
1
# frozen_string_literal: true
2
3
# Licensed to the Software Freedom Conservancy (SFC) under one
4
# or more contributor license agreements. See the NOTICE file
5
# distributed with this work for additional information
6
# regarding copyright ownership. The SFC licenses this file
7
# to you under the Apache License, Version 2.0 (the
8
# "License"); you may not use this file except in compliance
9
# with the License. You may obtain a copy of the License at
10
#
11
# http://www.apache.org/licenses/LICENSE-2.0
12
#
13
# Unless required by applicable law or agreed to in writing,
14
# software distributed under the License is distributed on an
15
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
# KIND, either express or implied. See the License for the
17
# specific language governing permissions and limitations
18
# under the License.
19
20
require File.expand_path('../../spec_helper', __dir__)
21
return if Selenium::WebDriver::Platform.jruby? || Selenium::WebDriver::Platform.truffleruby?
22
23
require 'selenium/webdriver/remote/http/curb'
24
require 'curb'
25
26
module Selenium
27
module WebDriver
28
module Remote
29
module Http
30
describe Curb do
31
subject(:curb) { described_class.new }
32
it 'assigns default timeout to 0.0' do
33
http = curb.send :client
34
35
expect(http.timeout).to eq 0.0
36
end
37
38
it 'sets the timeout' do
39
curb.timeout = 20
40
expect(curb.timeout).to eq 20
41
end
42
43
describe '#initialize' do
44
let(:curb) { described_class.new(timeout: 10) }
45
46
it 'is initialized with timeout' do
47
expect(curb.timeout).to eq 10
48
end
49
end
50
end
51
end # Http
52
end # Remote
53
end # WebDriver
54
end # Selenium
55
56