|
76 | 76 | let(:filename) do |
77 | 77 | 'https://example.local/myhash.json' |
78 | 78 | end |
79 | | - let(:basic_auth) { { http_basic_authentication: ['', ''] } } |
80 | 79 | let(:data) { { 'key' => 'value', 'ķęŷ' => 'νậŀųề', 'キー' => '値' } } |
81 | 80 | let(:json) { '{"key":"value", {"ķęŷ":"νậŀųề" }, {"キー":"値" }' } |
82 | 81 |
|
83 | 82 | it { |
84 | | - expect(OpenURI).to receive(:open_uri).with(filename, basic_auth).and_return(json) |
| 83 | + expect(OpenURI).to receive(:open_uri).with(filename).and_return(json) |
85 | 84 | expect(PSON).to receive(:load).with(json).and_return(data).once |
86 | 85 | is_expected.to run.with_params(filename).and_return(data) |
87 | 86 | } |
|
123 | 122 | let(:filename) do |
124 | 123 | 'https://example.local/myhash.json' |
125 | 124 | end |
126 | | - let(:basic_auth) { { http_basic_authentication: ['', ''] } } |
127 | 125 | let(:json) { ',;{"key":"value"}' } |
128 | 126 |
|
129 | 127 | it { |
130 | | - expect(OpenURI).to receive(:open_uri).with(filename, basic_auth).and_return(json) |
| 128 | + expect(OpenURI).to receive(:open_uri).with(filename).and_return(json) |
131 | 129 | expect(PSON).to receive(:load).with(json).once.and_raise StandardError, 'Something terrible have happened!' |
132 | 130 | is_expected.to run.with_params(filename, 'default' => 'value').and_return('default' => 'value') |
133 | 131 | } |
|
137 | 135 | let(:filename) do |
138 | 136 | 'https://example.local/myhash.json' |
139 | 137 | end |
140 | | - let(:basic_auth) { { http_basic_authentication: ['', ''] } } |
141 | 138 |
|
142 | 139 | it { |
143 | | - expect(OpenURI).to receive(:open_uri).with(filename, basic_auth).and_raise OpenURI::HTTPError, '404 File not Found' |
| 140 | + expect(OpenURI).to receive(:open_uri).with(filename).and_raise OpenURI::HTTPError, '404 File not Found' |
144 | 141 | is_expected.to run.with_params(filename, 'default' => 'value').and_return('default' => 'value') |
145 | 142 | } |
146 | 143 | end |
|
0 commit comments