Sha256: 610b2862d75459d032dbec037b86f91591c726651a60b7dae4b98922ee176f8a

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

require File.dirname(__FILE__) + "/test_helper"

class StaticMatic::SetupTest < Test::Unit::TestCase
  def setup
    setup_staticmatic
  end
  
  should "setup directories" do
    tmp_dir = File.dirname(__FILE__) + '/sandbox/tmp'
    staticmatic = StaticMatic::Base.new(tmp_dir)
    staticmatic.run('setup')
    
    StaticMatic::Base.base_dirs.each do |dir|
      assert File.exists?("#{tmp_dir}/#{dir}"), "Should create #{dir}"
    end
    
    StaticMatic::Base.base_dirs.reverse.each do |dir|
      Dir.entries("#{tmp_dir}/#{dir}").each do |file|
        next if file.match(/^\./)
        File.delete("#{tmp_dir}/#{dir}/#{file}")
      end
      Dir.delete("#{tmp_dir}/#{dir}") if File.exists?("#{tmp_dir}/#{dir}")
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
bdimcheff-staticmatic-0.10.1 test/setup_test.rb
staticmatic-0.10.2 test/setup_test.rb