Sha256: 822cab11e7be7bce1116b09925c853a34b590667e203e199ee740fef7edd8b46

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper.rb'
require 'smallcage'

describe "SmallCage::Commands::Export" do

  docroot = Pathname.new(File.dirname(__FILE__) + "/data/htdocs2")
  outdir = Pathname.new(File.dirname(__FILE__) + "/data/out")
  
  it "should export not smc files" do
    begin
      opts = { :command => "export", 
               :path => docroot.to_s,
               :out => outdir.to_s,
               :quiet => true }
      SmallCage::Runner.run(opts)
    
      (outdir + "./a/test.html.smc").exist?.should_not be_true
      (outdir + "./a/test.html").exist?.should_not be_true
      (outdir + "./a/b/test.html").exist?.should be_true
      (outdir + "./a/b/c/test.html").exist?.should be_true
    ensure
      FileUtils.rm_r(outdir)
    end
  end
  
  it "should export project subdirectory" do
    begin
      path = docroot + "a/b/c"
      opts = { :command => "export", 
               :path => path.to_s,
               :out => outdir.to_s,
               :quiet => true }
      SmallCage::Runner.run(opts)
    
      (outdir + "./a/test.html.smc").exist?.should_not be_true
      (outdir + "./a/test.html").exist?.should_not be_true
      (outdir + "./a/b/test.html").exist?.should_not be_true
      
      (outdir + "./a/b/c/test.html").exist?.should be_true
    ensure
      FileUtils.rm_r(outdir)
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

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