Skip to content

Commit 1dce954

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

3 files changed

Lines changed: 8 additions & 24 deletions

File tree

Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ test-domain:
3232
fi
3333
bundle exec rspec --example "$(DOMAIN)" spec/html2rss/configs_dynamic_spec.rb
3434

35-
test-debug:
36-
@if [ -z "$(CONFIG)" ]; then \
37-
echo "Usage: make test-debug CONFIG=github.com/releases.yml"; \
38-
exit 1; \
39-
fi
40-
DEBUG_CONFIG=$(CONFIG) bundle exec rspec spec/html2rss/configs_dynamic_spec.rb
41-
4235
# Migration commands
4336
migrate-tests:
4437
bin/migrate_to_dynamic_tests

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: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,14 @@
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
23-
24-
# Add debugging hook for specific configs
25-
if ENV['DEBUG_CONFIG'] == relative_path
26-
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}"
31-
expect(relative_path).to be_a(String) # Add meaningful expectation
32-
end
33-
end
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/', '')
3425
end
3526
end
3627
end

0 commit comments

Comments
 (0)