Sha256: 95e2064f993e4ae8ad2f3b544509ff907a7dd06ea3e729517bff81047fed01de

Contents?: true

Size: 1000 Bytes

Versions: 13

Compression:

Stored size: 1000 Bytes

Contents

require 'spec_helper'

describe ServerMetrics::Collector do
  let(:collector) { ServerMetrics::Collector.new }

  describe '#linux?' do
    it 'is true when target OS starts with linux' do
      collector.should_receive(:ruby_config).
        and_return( {'target_os' => 'linux42.0'} )
      expect(collector.linux?).to be true
    end

    it 'is false when target OS does not start with linux' do
      collector.should_receive(:ruby_config).
        and_return( {'target_os' => 'chunkybacon'} )
      expect(collector.linux?).to be false
    end
  end

  describe '#osx?' do
    it 'is true when target OS starts with darwin' do
      collector.should_receive(:ruby_config).
        and_return( {'target_os' => 'darwin42.0'} )
      expect(collector.osx?).to be true
    end

    it 'is false when target OS does not start with darwin' do
      collector.should_receive(:ruby_config).
        and_return( {'target_os' => 'chunkybacon'} )
      expect(collector.osx?).to be false
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
server_metrics-1.2.18 spec/server_metrics/collector_spec.rb
server_metrics-1.2.14 spec/server_metrics/collector_spec.rb
server_metrics-1.2.14.pre1 spec/server_metrics/collector_spec.rb
server_metrics-1.2.14.pre0 spec/server_metrics/collector_spec.rb
server_metrics-1.2.13 spec/server_metrics/collector_spec.rb
server_metrics-1.2.12 spec/server_metrics/collector_spec.rb
server_metrics-1.2.10 spec/server_metrics/collector_spec.rb
server_metrics-1.2.9.1 spec/server_metrics/collector_spec.rb
server_metrics-1.2.8 spec/server_metrics/collector_spec.rb
server_metrics-1.2.7 spec/server_metrics/collector_spec.rb
server_metrics-1.2.5 spec/server_metrics/collector_spec.rb
server_metrics-1.2.5.pre spec/server_metrics/collector_spec.rb
server_metrics-1.2.4 spec/server_metrics/collector_spec.rb