Sha256: f2934726231154e90f5e9b60e8957c545f2cbee9639cfeef570a2fc13a93276c

Contents?: true

Size: 781 Bytes

Versions: 2

Compression:

Stored size: 781 Bytes

Contents

module Helpers
  def create_routes
    destination = File.join(destination_root, "config")

    FileUtils.mkdir_p(destination)
    FileUtils.touch File.join(destination, 'routes.rb')
  end

  def create_app(options = {})
    Rails.application = nil
    Class.new(Rails::Application).tap do |app|
      app.config.assets.enabled = true
      app.config.assets.compress = true if options[:compress]
      app.config.assets.paths << fixture_root
      app.config.active_support.deprecation = :log
      app.initialize!
    end
  end

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

  def fixture(name)
    stylus = File.read(File.join(fixture_root, "#{name}.styl"))
    css    = File.read(File.join(fixture_root, "#{name}.css"))
    [stylus, css]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stylus-0.2.2 spec/support/helpers.rb
stylus-0.2.1 spec/support/helpers.rb