test/base/test_compiler_dsl.rb in nanoc-3.7.4 vs test/base/test_compiler_dsl.rb in nanoc-3.7.5
- old
+ new
@@ -1,19 +1,18 @@
# encoding: utf-8
class Nanoc::CompilerDSLTest < Nanoc::TestCase
-
def test_compile
- # TODO implement
+ # TODO: implement
end
def test_route
- # TODO implement
+ # TODO: implement
end
def test_layout
- # TODO implement
+ # TODO: implement
end
def test_preprocess_twice
rules_collection = Nanoc::RulesCollection.new(nil)
compiler_dsl = Nanoc::CompilerDSL.new(rules_collection, {})
@@ -36,11 +35,11 @@
def test_per_rules_file_preprocessor
# Create site
Nanoc::CLI.run %w( create_site per-rules-file-preprocessor )
FileUtils.cd('per-rules-file-preprocessor') do
# Create rep
- item = Nanoc::Item.new('foo', { :extension => 'bar' }, '/foo/')
+ item = Nanoc::Item.new('foo', { extension: 'bar' }, '/foo/')
# Create a bonus rules file
File.open('more_rules.rb', 'w') { |io| io.write "preprocess { @items['/foo/'][:preprocessed] = true }" }
# Create other necessary stuff
@@ -57,11 +56,11 @@
dsl.include_rules 'more_rules'
# Check that the two preprocess blocks have been added
assert_equal 2, site.compiler.rules_collection.preprocessors.size
refute_nil site.compiler.rules_collection.preprocessors.first
- refute_nil site.compiler.rules_collection.preprocessors.last
+ refute_nil site.compiler.rules_collection.preprocessors.to_a.last
# Apply preprocess blocks
site.compiler.preprocess
assert item[:preprocessed]
end
@@ -70,11 +69,11 @@
def test_include_rules
# Create site
Nanoc::CLI.run %w( create_site with_bonus_rules )
FileUtils.cd('with_bonus_rules') do
# Create rep
- item = Nanoc::Item.new('foo', { :extension => 'bar' }, '/foo/')
+ item = Nanoc::Item.new('foo', { extension: 'bar' }, '/foo/')
rep = Nanoc::ItemRep.new(item, :default)
# Create a bonus rules file
File.open('more_rules.rb', 'w') { |io| io.write "passthrough '/foo/'" }
@@ -375,11 +374,10 @@
end
end
def test_config
$venetian = 'unsnares'
- compiler_dsl = Nanoc::CompilerDSL.new(nil, { :venetian => 'snares' })
+ compiler_dsl = Nanoc::CompilerDSL.new(nil, { venetian: 'snares' })
compiler_dsl.instance_eval { $venetian = @config[:venetian] }
assert_equal 'snares', $venetian
end
-
end