File: profile_test_helper.rb

package info (click to toggle)
ruby-prof 0.7.3-1.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 468 kB
  • sloc: ruby: 2,377; ansic: 1,431; makefile: 31
file content (21 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Load profile environment
env = ENV["RAILS_ENV"] = "profile"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")

# Load Rails testing infrastructure
require 'test_help'

# Now we can load test_helper since we've already loaded the
# profile RAILS environment.
require File.expand_path(File.join(RAILS_ROOT, 'test', 'test_helper'))

# Reset the current environment back to profile
# since test_helper reset it to test
ENV["RAILS_ENV"] = env

# Now load ruby-prof and away we go
require 'ruby-prof'

# Setup output directory to Rails tmp directory
RubyProf::Test::PROFILE_OPTIONS[:output_dir] = 
    File.expand_path(File.join(RAILS_ROOT, 'tmp', 'profile'))