Sha256: 043204780b63c5d42c9591ba480854634a9085d5b30b16d57c421dbcfb16c625

Contents?: true

Size: 762 Bytes

Versions: 26

Compression:

Stored size: 762 Bytes

Contents

describe Bluepill::ProcessStatistics do
  before(:each) do
    @stats = Bluepill::ProcessStatistics.new
  end

  it "should record events" do
    @stats.record_event('some event', 'some reason')
    @stats.record_event('another event', 'another reason')
    @stats.events.should have(2).events
  end

  it "should record #EVENTS_TO_PERSIST events" do
    (2 * Bluepill::ProcessStatistics::EVENTS_TO_PERSIST).times do
      @stats.record_event('some event', 'some reason')
    end
    @stats.events.should have(Bluepill::ProcessStatistics::EVENTS_TO_PERSIST).events
  end

  it "should return event history" do
    @stats.record_event('some event', 'some reason')
    @stats.to_s.should match(/some reason/)
    @stats.to_s.should match(/event history/)
  end
end

Version data entries

26 entries across 26 versions & 5 rubygems

Version Path
bluepill-0.0.57 spec/lib/bluepill/process_statistics_spec.rb
bluepill-0.0.56 spec/lib/bluepill/process_statistics_spec.rb
bluepill-0.0.55 spec/lib/bluepill/process_statistics_spec.rb
bluepill-0.0.54 spec/lib/bluepill/process_statistics_spec.rb
bluepill-0.0.53 spec/lib/bluepill/process_statistics_spec.rb
bluepill-0.0.52 spec/lib/bluepill/process_statistics_spec.rb