Sha256: 8b0f97593dd1a9c4cda79f6121915d31e7d97ac3c5062e46b29e2795683f574b

Contents?: true

Size: 562 Bytes

Versions: 2

Compression:

Stored size: 562 Bytes

Contents

# encoding: utf-8

class Nanoc::CLI::Commands::CreateLayoutTest < Nanoc::TestCase
  def test_can_compile_new_layout
    require 'nanoc/cli'

    Nanoc::CLI.run %w( create_site foo )

    FileUtils.cd('foo') do
      # Create new layout
      Nanoc::CLI.run %w( create_layout moo )

      # Makes rules use new layout
      rules_raw = File.read('Rules')
      File.open('Rules', 'w') do |io|
        io.write rules_raw.sub("layout 'default'", "layout 'moo'")
      end

      site = Nanoc::Site.new('.')
      site.load_data
      site.compile
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nanoc-3.8.0 test/cli/commands/test_create_layout.rb
nanoc-3.7.5 test/cli/commands/test_create_layout.rb