summaryrefslogtreecommitdiff
path: root/spec/unit/util/profiler/wall_clock_spec.rb
blob: 1adcf0d6100b80c1eb24226a09bc28abfe90a608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'spec_helper'
require 'puppet/util/profiler'

describe Puppet::Util::Profiler::WallClock do

  it "logs the number of seconds it took to execute the segment" do
    profiler = Puppet::Util::Profiler::WallClock.new(nil, nil)

    message = profiler.do_finish(profiler.start(["foo", "bar"], "Testing"), ["foo", "bar"], "Testing")[:msg]

    message.should =~ /took \d\.\d{4} seconds/
  end
end