Sha256: 66446089d208d6b497d2a8eab9c47b4cb9e94f14ff20c6ac56ece574ee466bef

Contents?: true

Size: 629 Bytes

Versions: 7

Compression:

Stored size: 629 Bytes

Contents

require_relative '../../test_helper'

module Troo
  describe '.debug' do
    let(:filename) { 'profile.html' }
    let(:result)   { mock('result') }
    let(:file)     { mock('file') }
    let(:printer)  { mock('printer') }

    before do
      RubyProf.stubs(:start)
      RubyProf.stubs(:stop).returns(result)
      result.stubs(:eliminate_methods!)
      File.stubs(:open).yields(file)
      RubyProf::CallStackPrinter.stubs(:new).returns(printer)
      printer.stubs(:print)
    end

    subject { Troo.debug(filename) { :some_code } }

    it 'produces a pretty call stack' do
      subject.must_equal nil
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
troo-0.0.15 test/lib/troo/debug_test.rb
troo-0.0.14 test/lib/troo/debug_test.rb
troo-0.0.13 test/lib/troo/debug_test.rb
troo-0.0.12 test/lib/troo/debug_test.rb
troo-0.0.11 test/lib/troo/debug_test.rb
troo-0.0.10 test/lib/troo/debug_test.rb
troo-0.0.9 test/lib/troo/debug_test.rb