Sha256: 00d402e6ef34db77b66c2209023e6a2ed0db7024476938f92bc7974f0e39d3dd

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

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

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

1 entries across 1 versions & 1 rubygems

Version Path
system-metrics-0.1.0 spec/system_metrics_spec.rb