test/data_sources/test_filesystem.rb in nanoc-4.7.5 vs test/data_sources/test_filesystem.rb in nanoc-4.7.6

- old
+ new

@@ -545,16 +545,16 @@ # Create data source data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, allow_periods_in_identifiers: true) # Write sample files FileUtils.mkdir_p('foo') - %w(foo.html foo.yaml bar.entry.html foo/qux.yaml).each do |filename| + %w[foo.html foo.yaml bar.entry.html foo/qux.yaml].each do |filename| File.open(filename, 'w') { |io| io.write('test') } end # Write stray files - %w(foo.html~ foo.yaml.orig bar.entry.html.bak).each do |filename| + %w[foo.html~ foo.yaml.orig bar.entry.html.bak].each do |filename| File.open(filename, 'w') { |io| io.write('test') } end # Get all files output_expected = { @@ -572,16 +572,16 @@ # Create data source data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, nil) # Write sample files FileUtils.mkdir_p('foo') - %w(foo.html foo.yaml bar.html.erb foo/qux.yaml).each do |filename| + %w[foo.html foo.yaml bar.html.erb foo/qux.yaml].each do |filename| File.open(filename, 'w') { |io| io.write('test') } end # Write stray files - %w(foo.html~ foo.yaml.orig bar.entry.html.bak).each do |filename| + %w[foo.html~ foo.yaml.orig bar.entry.html.bak].each do |filename| File.open(filename, 'w') { |io| io.write('test') } end # Get all files output_expected = { @@ -598,11 +598,11 @@ def test_all_split_files_in_with_multiple_dirs # Create data source data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, nil) # Write sample files - %w(aaa/foo.html bbb/foo.html ccc/foo.html).each do |filename| + %w[aaa/foo.html bbb/foo.html ccc/foo.html].each do |filename| FileUtils.mkdir_p(File.dirname(filename)) File.open(filename, 'w') { |io| io.write('test') } end # Check @@ -618,29 +618,29 @@ # Create data source config = { identifier_type: 'full' } data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, config) # Write sample files - %w(stuff/foo.html stuff/foo.md stuff/foo.yaml).each do |filename| + %w[stuff/foo.html stuff/foo.md stuff/foo.yaml].each do |filename| FileUtils.mkdir_p(File.dirname(filename)) File.open(filename, 'w') { |io| io.write('test') } end # Check - { './stuff/foo' => ['yaml', ['html', 'md']] } res = data_source.send(:all_split_files_in, '.') assert_equal ['./stuff/foo'], res.keys assert_equal 2, res.values[0].size assert_equal 'yaml', res.values[0][0] assert_equal Array, res.values[0][1].class - assert_equal %w(html md), res.values[0][1].sort + assert_equal %w[html md], res.values[0][1].sort end def test_all_split_files_in_with_multiple_content_files # Create data source data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, nil) # Write sample files - %w(foo.html foo.xhtml foo.txt foo.yaml bar.html qux.yaml).each do |filename| + %w[foo.html foo.xhtml foo.txt foo.yaml bar.html qux.yaml].each do |filename| File.open(filename, 'w') { |io| io.write('test') } end # Check assert_raises(Nanoc::DataSources::Filesystem::Errors::MultipleContentFiles) do