File: proc_title_reporter_test.rb

package info (click to toggle)
ruby-metriks 0.9.9.8-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 288 kB
  • sloc: ruby: 1,877; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 463 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
22
23
24
25
require 'test_helper'

require 'metriks/reporter/proc_title'

class ProcTitleReporterTest < Test::Unit::TestCase
  def setup
    @reporter = Metriks::Reporter::ProcTitle.new
    @original_proctitle = $0.dup
  end

  def teardown
    @reporter.stop
    $0 = @original_proctitle
  end

  def test_generate_title
    @reporter.add 'test', '/sec' do
      50.333
    end

    title = @reporter.send(:generate_title)

    assert_equal 'test: 50.3/sec', title
  end
end