Skip to content

Commit 7d947b8

Browse files
committed
style: apply rubocop corrections
1 parent 7fb3a9b commit 7d947b8

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

bin/rspec_changed_configs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
changed_files = `git diff --name-only origin/master | grep 'lib/html2rss/configs/.*/.*.yml'`.split("\n")
55

6-
if changed_files.count.positive?
6+
if changed_files.any?
77
# Use dynamic test file with environment variable to filter changed configs
88
config_names = changed_files.map { |file| file.sub('lib/html2rss/configs/', '') }
99

spec/html2rss/configs_dynamic_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
end
1515

1616
config_files.each do |config_file|
17-
relative_path = config_file.sub('lib/html2rss/configs/', '')
18-
config_name = relative_path.tr('/', '_').gsub('.yml', '')
19-
domain = relative_path.split('/').first
17+
config_name = config_file.sub('lib/html2rss/configs/', '').tr('/', '_').gsub('.yml', '')
18+
domain = config_file.sub('lib/html2rss/configs/', '').split('/').first
2019

21-
describe "#{relative_path} (#{config_name})", config: config_name, domain: domain do
22-
it_behaves_like 'config.yml', relative_path
20+
describe "#{config_file.sub('lib/html2rss/configs/', '')} (#{config_name})",
21+
config: config_name,
22+
domain: domain,
23+
relative_path: config_file.sub('lib/html2rss/configs/', '') do
24+
it_behaves_like 'config.yml', config_file.sub('lib/html2rss/configs/', '')
2325

2426
# Add debugging hook for specific configs
25-
if ENV['DEBUG_CONFIG'] == relative_path
27+
if ENV['DEBUG_CONFIG'] == config_file.sub('lib/html2rss/configs/', '')
28+
let(:relative_path) { self.class.metadata[:relative_path] }
29+
2630
it 'debugs the config' do
27-
puts "Debugging config: #{relative_path}"
28-
puts "File path: #{config_file}"
29-
puts "Config name: #{config_name}"
30-
puts "Domain: #{domain}"
3131
expect(relative_path).to be_a(String) # Add meaningful expectation
3232
end
3333
end

0 commit comments

Comments
 (0)