Sha256: 3af262b871f7a91757b8a51d637af8f3e2aeb39b5b9aa37e3fd333a4452ca8ca

Contents?: true

Size: 634 Bytes

Versions: 1

Compression:

Stored size: 634 Bytes

Contents

require 'spec/helper'

spec_require 'ruby-prof'

Ramaze.contrib :profiling

class MainController < Ramaze::Controller
  def index
    100.times {"h" + "e" + "l" + "l" + "o"}
  end
end

output = StringIO.new
Ramaze::Log.loggers << Ramaze::Informer.new(output)

describe 'Profiling' do
  behaves_like "http"
  ramaze :public_root => __DIR__/:public

  it "should profile" do
    output = StringIO.new
    Ramaze::Log.loggers << Ramaze::Informer.new(output)

    get('/')
    output.string.should =~ /Thread ID:\s\d+/
    output.string.should =~ /Total:/
    output.string.should =~ /self\s+total\s+self\s+wait\s+child\s+call/
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clivecrous-ramaze-0.3.9.5 spec/contrib/profiling.rb