Sha256: 55fb1b79592c8f20744cb1a3ceef281c1b942fea26513a1b438b8703022642e5

Contents?: true

Size: 975 Bytes

Versions: 30

Compression:

Stored size: 975 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

30 entries across 30 versions & 1 rubygems

Version Path
request-log-analyzer-1.13.1 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.13.0 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.11 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.10 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.9 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.8 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.7 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.6 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.5 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.4 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.3 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.2 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.1 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.12.0 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.11.1 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.11.0 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.10.1 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.10.0 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.9.10 spec/unit/tracker/traffic_tracker_spec.rb
request-log-analyzer-1.9.9 spec/unit/tracker/traffic_tracker_spec.rb