Sha256: f9be8295d9699e602f38105a9d9c877a997b155aa0464b1ee2c66a10dedf80a0

Contents?: true

Size: 809 Bytes

Versions: 6

Compression:

Stored size: 809 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe SystemMetrics do
  it 'should allow setting collection status to off' do
    SystemMetrics.collection_off
    SystemMetrics.should_not be_collecting
  end

  it 'should allow setting collection status to on' do
    SystemMetrics.collection_on
    SystemMetrics.should be_collecting
  end

  it 'should indicate whether the current status is on' do
    SystemMetrics.collection_off
    SystemMetrics.collecting?.should be_false
    SystemMetrics.collection_on
    SystemMetrics.collecting?.should be_true
  end

  it 'should allow a block of code to execute with status off' do
    SystemMetrics.collection_on
    SystemMetrics.without_collection do
      SystemMetrics.should_not be_collecting
    end
    SystemMetrics.should be_collecting
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
system-metrics-0.2.5 spec/system_metrics_spec.rb
system-metrics-0.2.4 spec/system_metrics_spec.rb
system-metrics-0.2.3 spec/system_metrics_spec.rb
system-metrics-0.2.2 spec/system_metrics_spec.rb
system-metrics-0.2.1 spec/system_metrics_spec.rb
system-metrics-0.2.0 spec/system_metrics_spec.rb