Sha256: d5e90f11f5e5b1a6cfd64314283a85180438b375f75f437cc25f29a658e518b6

Contents?: true

Size: 1 KB

Versions: 9

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe Speedos::Entries do
  context '#total_load_time' do
    subject { Speedos::Entries }

    context 'when all tasks start the same time' do
      it 'returns the greatest load time' do
        entries = subject.new([
          {'startedDateTime' => DateTime.new(2012,1,1,12).to_s, 'time' => 100},
          {'startedDateTime' => DateTime.new(2012,1,1,12).to_s, 'time' => 50},
        ])
        entries.total_load_time.should eq 100
      end
    end

    context 'when tasks are started at the same time' do
      it 'returns the total time needed' do
        entries = subject.new([
          {'startedDateTime' => DateTime.new(2012,1,1,12,0,0).to_s, 'time' => 100},
          {'startedDateTime' => DateTime.new(2012,1,1,12,0,1).to_s, 'time' => 50},
        ])
        entries.total_load_time.should eq 1050
      end
    end
  end

  context '#name' do
    subject { Speedos::Entries.new([{'pageref' => 'page 1'}, {'pageref' => 'page 1'},]) }

    its(:name) { should eq 'page 1' }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
speedos-0.0.11 spec/lib/entries_spec.rb
speedos-0.0.10 spec/lib/entries_spec.rb
speedos-0.0.9 spec/lib/entries_spec.rb
speedos-0.0.8 spec/lib/entries_spec.rb
speedos-0.0.7 spec/lib/entries_spec.rb
speedos-0.0.6 spec/lib/entries_spec.rb
speedos-0.0.5 spec/lib/entries_spec.rb
speedos-0.0.4 spec/lib/entries_spec.rb
speedos-0.0.3 spec/lib/entries_spec.rb