|
14 | 14 | end |
15 | 15 |
|
16 | 16 | 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 |
20 | 19 |
|
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/', '') |
23 | 25 |
|
24 | 26 | # 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 | + |
26 | 30 | 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 | 31 | expect(relative_path).to be_a(String) # Add meaningful expectation |
32 | 32 | end |
33 | 33 | end |
|
0 commit comments