test/base/test_site.rb in nanoc-4.7.9 vs test/base/test_site.rb in nanoc-4.7.10
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'helper'
class Nanoc::Int::SiteTest < Nanoc::TestCase
def test_initialize_with_dir_without_config_yaml
assert_raises(Nanoc::Int::ConfigLoader::NoConfigFileFoundError) do
@@ -32,30 +34,30 @@
assert_equal({}, site.config[:data_sources][0][:config])
end
def test_initialize_with_existing_parent_config_file
File.open('nanoc.yaml', 'w') do |io|
- io.write <<-EOF
-output_dir: public_html
-parent_config_file: foo/foo.yaml
+ io.write <<~EOF
+ output_dir: public_html
+ parent_config_file: foo/foo.yaml
EOF
end
FileUtils.mkdir_p('foo')
FileUtils.cd('foo') do
File.open('foo.yaml', 'w') do |io|
- io.write <<-EOF
-parent_config_file: ../bar/bar.yaml
+ io.write <<~EOF
+ parent_config_file: ../bar/bar.yaml
EOF
end
end
FileUtils.mkdir_p('bar')
FileUtils.cd('bar') do
File.open('bar.yaml', 'w') do |io|
- io.write <<-EOF
-enable_output_diff: true
-foo: bar
-output_dir: output
+ io.write <<~EOF
+ enable_output_diff: true
+ foo: bar
+ output_dir: output
EOF
end
end
site = Nanoc::Int::SiteLoader.new.new_from_cwd
@@ -65,30 +67,30 @@
assert_equal 'public_html', site.config[:output_dir]
end
def test_initialize_with_missing_parent_config_file
File.open('nanoc.yaml', 'w') do |io|
- io.write <<-EOF
-parent_config_file: foo/foo.yaml
+ io.write <<~EOF
+ parent_config_file: foo/foo.yaml
EOF
end
assert_raises(Nanoc::Int::ConfigLoader::NoParentConfigFileFoundError) do
Nanoc::Int::SiteLoader.new.new_from_cwd
end
end
def test_initialize_with_parent_config_file_cycle
File.open('nanoc.yaml', 'w') do |io|
- io.write <<-EOF
-parent_config_file: foo/foo.yaml
+ io.write <<~EOF
+ parent_config_file: foo/foo.yaml
EOF
end
FileUtils.mkdir_p('foo')
FileUtils.cd('foo') do
File.open('foo.yaml', 'w') do |io|
- io.write <<-EOF
-parent_config_file: ../nanoc.yaml
+ io.write <<~EOF
+ parent_config_file: ../nanoc.yaml
EOF
end
end
assert_raises(Nanoc::Int::ConfigLoader::CyclicalConfigFileError) do