Sha256: fdf2cd236e69b5e8f55e0099fb46a4599e365d2804f9a870b29f5765ac78cb66

Contents?: true

Size: 811 Bytes

Versions: 1

Compression:

Stored size: 811 Bytes

Contents

require 'common'
require_relative '../../lib/locomotive/steam/initializers'

module Spec
  module Helpers

    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 run_server
      Locomotive::Common.reset
      Locomotive::Common.configure do |config|
        path = File.join(File.expand_path('../../spec/fixtures/default/log/locomotivecms.log'))
        config.notifier = Locomotive::Common::Logger.setup(path)
      end

      Locomotive::Common::Logger.info 'Server started...'

      reader = Locomotive::Mounter::Reader::FileSystem.instance
      reader.run!(path: 'spec/fixtures/default')

      Locomotive::Steam::Server.new(reader)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
locomotivecms_steam-0.1.1 spec/support/helpers.rb