Sha256: 408c41e6b69ec4c78fec7dbd7174e7d6e866b906d000f0794ae1e28a2afb8f9e

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper.rb'
require 'smallcage'

describe "SmallCage::Commands::Manifest" do

  before do
    @docroot = Pathname.new(File.dirname(__FILE__) + "/data/htdocs1")
    @opts = { :path => @docroot.to_s }
    @manifest_file = @docroot + "Manifest.html"
  end

  it "should create Manifest.html" do

    SmallCage::Runner.run(@opts.merge(:command => "manifest"))
    @manifest_file.file?.should be_true

    source = @manifest_file.read
    source = source.match(%r{<ul class="files">\n(.+?)\n</ul>}m)[1].split(/\n/)

    contents = <<'EOT'.split(/\n/)
<li><a href="./_dir.smc">./_dir.smc</a></li>
<li><a href="./_smc/">./_smc/</a></li>
<li><a href="./_smc/filters/">./_smc/filters/</a></li>
<li><a href="./_smc/filters/filters.yml">./_smc/filters/filters.yml</a></li>
<li><a href="./a/">./a/</a></li>
<li><a href="./a/b/">./a/b/</a></li>
<li><a href="./a/b/c/">./a/b/c/</a></li>
<li><a href="./a/b/c/index.html.smc">./a/b/c/index.html.smc</a></li>
EOT

    source.each do |line|
      contents.should include(line)
    end
  end
  
  after do
    SmallCage::Runner.run(@opts.merge(:command => "clean", :quiet => true))
    @manifest_file.delete
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smallcage-0.2.4 spec/manifest_spec.rb
smallcage-0.2.3 spec/manifest_spec.rb