test/cli/commands/test_create_site.rb in nanoc-3.8.0 vs test/cli/commands/test_create_site.rb in nanoc-4.0.0a1
- old
+ new
@@ -1,32 +1,30 @@
# encoding: utf-8
class Nanoc::CLI::Commands::CreateSiteTest < Nanoc::TestCase
def test_create_site_with_existing_name
Nanoc::CLI.run %w( create_site foo )
- assert_raises(::Nanoc::Errors::GenericTrivial) do
+ assert_raises(::Nanoc::Int::Errors::GenericTrivial) do
Nanoc::CLI.run %w( create_site foo )
end
end
def test_can_compile_new_site
Nanoc::CLI.run %w( create_site foo )
FileUtils.cd('foo') do
- site = Nanoc::Site.new('.')
- site.load_data
+ site = Nanoc::Int::Site.new('.')
site.compile
end
end
def test_can_compile_new_site_with_binary_items
Nanoc::CLI.run %w( create_site foo )
FileUtils.cd('foo') do
File.open('content/blah', 'w') { |io| io << 'asdf' }
- site = Nanoc::Site.new('.')
- site.load_data
+ site = Nanoc::Int::Site.new('.')
site.compile
assert File.file?('output/blah')
end
end
@@ -43,18 +41,18 @@
Nanoc::CLI.run %w( create_site foo )
FileUtils.cd('foo') do
# Try with encoding = default encoding = utf-8
File.open('content/index.html', 'w') { |io| io.write("Hello <\xD6>!\n") }
- site = Nanoc::Site.new('.')
+ site = Nanoc::Int::Site.new('.')
exception = assert_raises(RuntimeError) do
site.compile
end
assert_equal 'Could not read content/index.html because the file is not valid UTF-8.', exception.message
# Try with encoding = specific
File.open('nanoc.yaml', 'w') { |io| io.write("meh: true\n") }
- site = Nanoc::Site.new('.')
+ site = Nanoc::Int::Site.new('.')
site.compile
end
FileUtils
ensure
Encoding.default_external = original_encoding