|
17 | 17 | # specific language governing permissions and limitations
|
18 | 18 | # under the License.
|
19 | 19 |
|
20 |
| - |
21 | 20 | require File.expand_path('../spec_helper', __dir__)
|
22 | 21 | require 'selenium/webdriver/common/print_options'
|
23 | 22 |
|
24 |
| - |
25 | 23 | module Selenium
|
26 | 24 | module WebDriver
|
27 | 25 | describe PrintOptions do
|
28 |
| - let(:options) { PrintOptions.new } |
| 26 | + let(:options) { described_class.new } |
29 | 27 |
|
30 | 28 | it 'has default values' do
|
31 | 29 | expect(options.orientation).to eq('portrait')
|
32 | 30 | expect(options.scale).to eq(1.0)
|
33 | 31 | expect(options.background).to be(false)
|
34 |
| - expect(options.page_size).to eq({ width: 21.0, height: 29.7 }) |
35 |
| - expect(options.margins).to eq({ top: 1.0, bottom: 1.0, left: 1.0, right: 1.0 }) |
| 32 | + expect(options.page_size).to eq({width: 21.0, height: 29.7}) |
| 33 | + expect(options.margins).to eq({top: 1.0, bottom: 1.0, left: 1.0, right: 1.0}) |
36 | 34 | end
|
37 | 35 |
|
38 | 36 | it 'can set custom page size' do
|
39 |
| - custom_size = { width: 25.0, height: 30.0 } |
| 37 | + custom_size = {width: 25.0, height: 30.0} |
40 | 38 | options.page_size = custom_size
|
41 | 39 | expect(options.page_size).to eq(custom_size)
|
42 | 40 | end
|
43 | 41 |
|
44 | 42 | it 'can set predefined page sizes using symbols' do
|
45 | 43 | options.page_size = :a4
|
46 |
| - expect(options.page_size).to eq({ width: 21.0, height: 29.7 }) |
| 44 | + expect(options.page_size).to eq({width: 21.0, height: 29.7}) |
47 | 45 |
|
48 | 46 | options.page_size = :legal
|
49 |
| - expect(options.page_size).to eq({ width: 21.59, height: 35.56 }) |
| 47 | + expect(options.page_size).to eq({width: 21.59, height: 35.56}) |
50 | 48 |
|
51 | 49 | options.page_size = :tabloid
|
52 |
| - expect(options.page_size).to eq({ width: 27.94, height: 43.18 }) |
| 50 | + expect(options.page_size).to eq({width: 27.94, height: 43.18}) |
53 | 51 |
|
54 | 52 | options.page_size = :letter
|
55 |
| - expect(options.page_size).to eq({ width: 21.59, height: 27.94 }) |
| 53 | + expect(options.page_size).to eq({width: 21.59, height: 27.94}) |
56 | 54 | end
|
57 | 55 |
|
58 | 56 | it 'raises an error for unsupported predefined page size symbols' do
|
|
0 commit comments