Sha256: 67186b2637cb502cfcf4bbe3e762b466cd1e42fabe85f9f12a6c5a15a60104f8

Contents?: true

Size: 999 Bytes

Versions: 35

Compression:

Stored size: 999 Bytes

Contents

module Spec
  module Helpers

    def default_site_path
      File.expand_path('../../fixtures/default', __FILE__)
    end

    def reset!
      FileUtils.rm_rf(File.expand_path('../../../site', __FILE__))
    end

    def remove_logs
      FileUtils.rm_rf(File.expand_path('../../fixtures/default/log', __FILE__))
    end

    def restore_deploy_file(path)
      FileUtils.cp(File.join(path, 'config', 'deploy_example.yml'), File.join(path, 'config', 'deploy.yml'))
    end

    def working_copy_of_site(name)
      tmp_path = File.expand_path('../../tmp', __FILE__)
      tmp_path = FileUtils.mkdir_p(tmp_path)
      File.join(tmp_path, name.to_s)
    end

    def make_working_copy_of_site(name)
      source = File.join(File.expand_path('../../fixtures', __FILE__), name.to_s)
      target = working_copy_of_site(name)

      FileUtils.cp_r(source, target)
    end

    def remove_working_copy_of_site(name)
      path = working_copy_of_site(name)
      FileUtils.rm_rf(path)
    end

  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
locomotivecms_wagon-3.0.0 spec/support/helpers.rb
locomotivecms_wagon-3.0.0.rc0 spec/support/helpers.rb
locomotivecms_wagon-3.0.0.beta2 spec/support/helpers.rb
locomotivecms_wagon-2.4.1 spec/support/helpers.rb
locomotivecms_wagon-2.4.0 spec/support/helpers.rb
locomotivecms_wagon-2.4.0.rc2 spec/support/helpers.rb
locomotivecms_wagon-2.4.0.rc1 spec/support/helpers.rb
locomotivecms_wagon-2.3.0 spec/support/helpers.rb
locomotivecms_wagon-2.3.0.rc1 spec/support/helpers.rb
locomotivecms_wagon-2.2.0 spec/support/helpers.rb
locomotivecms_wagon-2.2.0.rc3 spec/support/helpers.rb
locomotivecms_wagon-2.2.0.rc2 spec/support/helpers.rb
locomotivecms_wagon-2.2.0.rc1 spec/support/helpers.rb
locomotivecms_wagon-2.2.0.beta1 spec/support/helpers.rb
locomotivecms_wagon-2.1.1 spec/support/helpers.rb
locomotivecms_wagon-2.1.0 spec/support/helpers.rb
locomotivecms_wagon-2.1.0.rc5 spec/support/helpers.rb
locomotivecms_wagon-2.1.0.rc4 spec/support/helpers.rb
locomotivecms_wagon-2.1.0.rc3 spec/support/helpers.rb
locomotivecms_wagon-2.0.1 spec/support/helpers.rb