|
9 | 9 | before do |
10 | 10 | stub_checksum_request |
11 | 11 | allow(check).to(receive(:output)) |
12 | | - allow(Open3).to(receive(:capture3).and_return([stdout, stderr, double(:success? => success)])) |
| 12 | + allow(Open3).to( |
| 13 | + receive(:capture3).and_return([stdout, stderr, double(success?: success)]) |
| 14 | + ) |
13 | 15 | end |
14 | 16 |
|
15 | 17 | let(:checksum_request) do |
|
20 | 22 | end |
21 | 23 |
|
22 | 24 | let(:response) do |
23 | | - { body: '285ec90006a6961ebcb7dd9685acc0ebcd08f561 minio.RELEASE.2021-07-08T19-43-25Z', status: 200 } |
| 25 | + { |
| 26 | + body: |
| 27 | + '285ec90006a6961ebcb7dd9685acc0ebcd08f561 '\ |
| 28 | + 'minio.RELEASE.2021-07-08T19-43-25Z', |
| 29 | + status: 200 |
| 30 | + } |
24 | 31 | end |
25 | 32 |
|
26 | 33 | alias_method :stub_checksum_request, :checksum_request |
|
43 | 50 | expect(error.status).to eq 0 |
44 | 51 | end |
45 | 52 |
|
46 | | - expect(check).to have_received(:output).with('No new minio version available') |
| 53 | + expect(check).to have_received(:output).with( |
| 54 | + 'No new minio version available' |
| 55 | + ) |
47 | 56 | expect(checksum_request).to have_been_requested |
48 | 57 | end |
49 | 58 | end |
50 | 59 |
|
51 | 60 | context 'with different local and remote versions' do |
52 | 61 | let(:response) do |
53 | | - { body: '285ec90006a6961ebcb7dd9685acc0ebcd08f561 minio.RELEASE.2022-07-08T19-43-25Z', status: 200 } |
| 62 | + { |
| 63 | + body: |
| 64 | + '285ec90006a6961ebcb7dd9685acc0ebcd08f561 '\ |
| 65 | + 'minio.RELEASE.2022-07-08T19-43-25Z', |
| 66 | + status: 200 |
| 67 | + } |
54 | 68 | end |
55 | 69 |
|
56 | 70 | it 'should be critical' do |
|
59 | 73 | expect(error.status).to eq 2 |
60 | 74 | end |
61 | 75 |
|
62 | | - expect(check).to have_received(:output).with('New minio version available RELEASE.2022-07-08T19-43-25Z') |
| 76 | + expect(check).to have_received(:output).with( |
| 77 | + 'New minio version available RELEASE.2022-07-08T19-43-25Z' |
| 78 | + ) |
63 | 79 | expect(checksum_request).to have_been_requested |
64 | 80 | end |
65 | 81 | end |
|
75 | 91 | expect(error.status).to eq 3 |
76 | 92 | end |
77 | 93 |
|
78 | | - expect(check).to have_received(:output).with('Unable to gather local minio version: Minio not found') |
| 94 | + expect(check).to have_received(:output).with( |
| 95 | + 'Unable to gather local minio version: Minio not found' |
| 96 | + ) |
79 | 97 | expect(checksum_request).to have_been_requested |
80 | 98 | end |
81 | 99 | end |
|
89 | 107 | expect(error.status).to eq 3 |
90 | 108 | end |
91 | 109 |
|
92 | | - expect(check).to have_received(:output).with('Unable to gather latest minio version: 404 Not Found') |
| 110 | + expect(check).to have_received(:output).with( |
| 111 | + 'Unable to gather latest minio version: 404 Not Found' |
| 112 | + ) |
93 | 113 | expect(checksum_request).to have_been_requested |
94 | 114 | end |
95 | 115 | end |
|
0 commit comments