test/cli/commands/test_compile.rb in nanoc3-3.2.0a4 vs test/cli/commands/test_compile.rb in nanoc3-3.2.0b1
- old
+ new
@@ -1,12 +1,33 @@
# encoding: utf-8
-require 'test/helper'
-
class Nanoc3::CLI::Commands::CompileTest < MiniTest::Unit::TestCase
include Nanoc3::TestHelpers
- def test_stub
+ def test_profiling_information
+ with_site do |site|
+ Nanoc3::CLI.run %w( create_item foo )
+ Nanoc3::CLI.run %w( create_item bar )
+ Nanoc3::CLI.run %w( create_item baz )
+
+ File.open('Rules', 'w') do |io|
+ io.write "compile '*' do\n"
+ io.write " filter :erb\n"
+ io.write "end\n"
+ io.write "\n"
+ io.write "route '*' do\n"
+ io.write " if item.binary?\n"
+ io.write " item.identifier.chop + '.' + item[:extension]\n"
+ io.write " else\n"
+ io.write " item.identifier + 'index.html'\n"
+ io.write " end\n"
+ io.write "end\n"
+ io.write "\n"
+ io.write "layout '*', :erb\n"
+ end
+
+ Nanoc3::CLI.run %w( compile --verbose )
+ end
end
end