Sha256: 56b7e128278c58e27c06965ddd1bfd93e23a563221338e4152ec5d59ed55a622

Contents?: true

Size: 951 Bytes

Versions: 2

Compression:

Stored size: 951 Bytes

Contents

require 'spec_helper'

describe RequestLogAnalyzer::Tracker::Traffic do

  describe '#report' do
    before(:each) do
      @tracker = RequestLogAnalyzer::Tracker::Traffic.new(category: :category, traffic: :traffic)
      @tracker.prepare
    end

    it 'should generate a report without errors when one category is present' do
      @tracker.update(request(category: 'a', traffic: 2))
      @tracker.report(mock_output)
      lambda { @tracker.report(mock_output) }.should_not raise_error
    end

    it 'should generate a report without errors when no category is present' do
      lambda { @tracker.report(mock_output) }.should_not raise_error
    end

    it 'should generate a report without errors when multiple categories are present' do
      @tracker.update(request(category: 'a', traffic: 2))
      @tracker.update(request(category: 'b', traffic: 2))
      lambda { @tracker.report(mock_output) }.should_not raise_error
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
request-log-analyzer-1.13.4 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.13.3 spec/unit/tracker/traffic_tracker_spec.rb