Sha256: 4667bf71a1c5d1ab787bbaf0f33db26a4affd041088fbd0e77cf54d24efd4c64

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require_relative "helper"


describe "when creating a Lanyon application" do

  before do
    tempdir = setup_tempdir
    chdir_tempdir

    destdir = File.join(tempdir, "_site")

    @dir_options = { :source => sourcedir, :destination => destdir }
    @page = File.join(destdir, "index.html")
    @no_page = File.join(destdir, "not_a_page.html")

    FileUtils.mkdir_p(destdir)
    FileUtils.touch(@no_page)
    assert  File.exist?(@no_page)
    assert !File.exist?(@page)
  end

  after do
    teardown_tempdir
  end

  it "builds the site by default, removing old content" do
    silence_output do
      Lanyon.application(@dir_options)
    end

    file_must_exist(@page)
    file_wont_exist(@no_page)
  end

  it "does not build the site when :skip_build option is set" do
    options = {:skip_build => true}.merge(@dir_options)
    silence_output do
      Lanyon.application(options)
    end

    file_must_exist(@no_page)
    file_wont_exist(@page)
  end

  it "does always build the site with ::build" do
    options = {:skip_build => true}.merge(@dir_options)
    silence_output do
      Lanyon.build(options)
    end

    file_must_exist(@page)
    file_wont_exist(@no_page)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lanyon-0.4.0 test/test_build.rb
lanyon-0.3.4 test/test_build.rb
lanyon-0.3.3 test/test_build.rb
lanyon-0.3.2 test/test_build.rb
lanyon-0.3.1 test/test_build.rb
lanyon-0.3.0 test/test_build.rb