test/data_sources/test_filesystem.rb in nanoc-4.4.5 vs test/data_sources/test_filesystem.rb in nanoc-4.4.6
- old
+ new
@@ -1,5 +1,7 @@
+require 'helper'
+
class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
def new_data_source(params = nil)
# Mock site
site = Nanoc::Int::SiteLoader.new.new_empty
@@ -67,11 +69,11 @@
end
end
def test_load_objects_with_same_extensions
# Create data source
- data_source = new_data_source({ identifier_type: 'full' })
+ data_source = new_data_source(identifier_type: 'full')
# Create a fake class
klass = Class.new do
attr_reader :stuff
def initialize(*stuff)
@@ -140,11 +142,11 @@
end
end
def test_identifier_for_filename_with_full_style_identifier
# Create data source
- data_source = new_data_source({ identifier_type: 'full' })
+ data_source = new_data_source(identifier_type: 'full')
# Get input and expected output
expected = {
'/foo' => Nanoc::Identifier.new('/foo', type: :full),
'/foo.html' => Nanoc::Identifier.new('/foo.html', type: :full),
@@ -461,11 +463,11 @@
end
end
end
def test_load_objects_correct_identifier_with_separate_yaml_file
- data_source = new_data_source({ identifier_type: 'full' })
+ data_source = new_data_source(identifier_type: 'full')
FileUtils.mkdir_p('foo')
File.write('foo/donkey.jpeg', 'data')
File.write('foo/donkey.yaml', "---\nalt: Donkey\n")
@@ -539,11 +541,11 @@
assert_equal Encoding.find('UTF-8'), items[0].content.string.encoding
end
def test_all_split_files_in_allowing_periods_in_identifiers
# Create data source
- data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, { allow_periods_in_identifiers: true })
+ 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|
File.open(filename, 'w') { |io| io.write('test') }
@@ -647,11 +649,11 @@
end
end
def test_basename_of_allowing_periods_in_identifiers
# Create data source
- data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, { allow_periods_in_identifiers: true })
+ data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, allow_periods_in_identifiers: true)
# Get input and expected output
expected = {
'/' => '/',
'/foo' => '/foo',
@@ -707,10 +709,10 @@
end
end
def test_ext_of_allowing_periods_in_identifiers
# Create data source
- data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, { allow_periods_in_identifiers: true })
+ data_source = Nanoc::DataSources::Filesystem.new(nil, nil, nil, allow_periods_in_identifiers: true)
# Get input and expected output
expected = {
'/' => '',
'/foo' => '',