Skip to content

Commit f96147b

Browse files
committed
test: fix rubocop offenses in browserless specs
1 parent e9b0def commit f96147b

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

spec/browserless_fetch_configs_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
RSpec.describe BrowserlessFetchConfigs do
44
describe '.browserless_env_configured?' do
55
around do |example|
6-
original_ws_url = ENV['BROWSERLESS_IO_WEBSOCKET_URL']
7-
original_api_token = ENV['BROWSERLESS_IO_API_TOKEN']
6+
original_ws_url = ENV.fetch('BROWSERLESS_IO_WEBSOCKET_URL', nil)
7+
original_api_token = ENV.fetch('BROWSERLESS_IO_API_TOKEN', nil)
88

99
example.run
1010
ensure

spec/support/shared_examples/config.yml_spec.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
config
3131
end
3232

33-
context 'with the file' do # rubocop:disable RSpec/MultipleMemoizedHelpers
33+
context 'with the file' do
3434
let(:host_name) { Helper.url_to_host_name yaml['channel']['url'] }
3535
let(:domain_name) { Helper.url_to_registrable_domain yaml['channel']['url'] }
3636
let(:dirname) { File.dirname(file_path).split(File::Separator).last }
@@ -108,7 +108,10 @@
108108
next unless BrowserlessFetchConfigs.include?(file_name)
109109
next if BrowserlessFetchConfigs.browserless_env_configured?
110110

111-
skip "Browserless fetch for #{file_name} requires BROWSERLESS_IO_WEBSOCKET_URL and, for custom endpoints, BROWSERLESS_IO_API_TOKEN"
111+
skip(
112+
"Browserless fetch for #{file_name} requires BROWSERLESS_IO_WEBSOCKET_URL and, " \
113+
'for custom endpoints, BROWSERLESS_IO_API_TOKEN'
114+
)
112115
end
113116

114117
it 'has positive amount of items' do
@@ -141,7 +144,10 @@
141144
next unless BrowserlessFetchConfigs.include?(file_name)
142145
next if BrowserlessFetchConfigs.browserless_env_configured?
143146

144-
skip "Browserless fetch for #{file_name} requires BROWSERLESS_IO_WEBSOCKET_URL and, for custom endpoints, BROWSERLESS_IO_API_TOKEN"
147+
skip(
148+
"Browserless fetch for #{file_name} requires BROWSERLESS_IO_WEBSOCKET_URL and, " \
149+
'for custom endpoints, BROWSERLESS_IO_API_TOKEN'
150+
)
145151
end
146152

147153
it 'has no empty text attributes', :aggregate_failures do

0 commit comments

Comments
 (0)