class AssetsTest

Public Instance Methods

setup() click to toggle source
# File test/assets_test.rb, line 5
def setup
  require "rails"
  require "action_controller/railtie"
  require "sprockets/railtie"

  @app = Class.new(Rails::Application)
  @app.config.active_support.deprecation = :stderr
  @app.config.assets.enabled = true
  @app.config.assets.cache_store = [ :file_store, "#{tmp_path}/cache" ]
  @app.paths["log"] = "#{tmp_path}/log/test.log"
  @app.initialize!
end
teardown() click to toggle source
# File test/assets_test.rb, line 18
def teardown
  FileUtils.rm_rf "#{tmp_path}/cache"
  FileUtils.rm_rf "#{tmp_path}/log"
  File.delete "#{tmp_path}/coffee-script.js"
end
tmp_path() click to toggle source
# File test/assets_test.rb, line 31
def tmp_path
  "#{File.dirname(__FILE__)}/tmp"
end