test/base/test_compiler.rb in nanoc-3.6.1 vs test/base/test_compiler.rb in nanoc-3.6.2
- old
+ new
@@ -1,11 +1,9 @@
# encoding: utf-8
-class Nanoc::CompilerTest < MiniTest::Unit::TestCase
+class Nanoc::CompilerTest < Nanoc::TestCase
- include Nanoc::TestHelpers
-
def test_compilation_rule_for
# Mock rules
rules = [ mock, mock, mock ]
rules[0].expects(:applicable_to?).returns(false)
rules[1].expects(:applicable_to?).returns(true)
@@ -514,9 +512,32 @@
site = Nanoc::Site.new('.')
site.compile
# Check
assert_equal '@rep.name = default - @item_rep.name = default', File.read('output/index.html')
+ end
+ end
+
+ def test_unfiltered_binary_item_should_not_be_moved_outside_content
+ with_site do
+ File.open('content/blah.dat', 'w') { |io| io.write('o hello') }
+
+ File.open('Rules', 'w') do |io|
+ io.write "compile '*' do\n"
+ io.write "end\n"
+ io.write "\n"
+ io.write "route '*' do\n"
+ io.write " item.identifier.chop + '.' + item[:extension]\n"
+ io.write "end\n"
+ io.write "\n"
+ io.write "layout '*', :erb\n"
+ end
+
+ site = Nanoc::Site.new('.')
+ site.compile
+
+ assert_equal Set.new(%w( content/blah.dat )), Set.new(Dir['content/*'])
+ assert_equal Set.new(%w( output/blah.dat )), Set.new(Dir['output/*'])
end
end
end