Sha256: 58a57a7232f2cc324b7eb8acb7e08be656b1f071370992136313e8f5bfb4b544

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper.rb'
require 'smallcage'

describe "SmallCage::Commands::Export" do
  docroot = Pathname.new(File.join(SPEC_DATA_DIR, 'htdocs2'))
  outdir = Pathname.new(File.join(SPEC_DATA_DIR, '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.6 spec/lib/smallcage/commands/export_spec.rb
smallcage-0.2.5 spec/lib/smallcage/commands/export_spec.rb