Sha256: b70af9bf3b2651f0012aca28842b5931bc39d47cc11a3840d9a0a9c35d42556c

Contents?: true

Size: 804 Bytes

Versions: 5

Compression:

Stored size: 804 Bytes

Contents

require 'test/unit'
require 'rack/test'

module OwlTestIncludes
  require 'fileutils'
  require File.expand_path File.join('core', 'app')
  include Rack::Test::Methods

  ROOT              = File.expand_path('../..', __FILE__)
  SAMPLE_DATA_PATH  = File.expand_path './my-site'
  BIN_PATH          = File.expand_path './bin/owl'

  def app
    Owl::CMS::App
  end

  def setup
    teardown
    FileUtils.mkdir_p SAMPLE_DATA_PATH
    Dir.chdir SAMPLE_DATA_PATH
    system "#{BIN_PATH} init"
  end

  def teardown
    Dir.chdir ROOT
    FileUtils.rm_rf SAMPLE_DATA_PATH
  end

  def page(path='/home')
    page   = Owl::Lib::Page.new(path, current_scope)
  end

  def setup_page(path='/home')
    @page   = page
    @path   = @page.path
  end

  def current_scope
    Owl::CMS::App.new.helpers
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
owl-cms-0.1.5 test/test_includes.rb
owl-cms-0.1.3 test/test_includes.rb
owl-cms-0.1.2 test/test_includes.rb
owl-cms-0.1.1 test/test_includes.rb
owl-cms-0.1.0 test/test_includes.rb