Sha256: 169127fbd882f87e2299329642a14baff93ba22e7ef0a431b47f37122ad75359

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe '[play] subcommand' do
  it 'should print 3 JSON records for busy100.pgr' do
    busy100 = data_file "busy100.pgr"
    cmd = "#{perfmonger_bin} play #{busy100}"
    run(cmd)
    expect(last_command_started).to be_successfully_executed
    expect(last_command_started.stdout.lines.to_a.size).to eq 3

    run(cmd)
    last_command_started.stdout.each_line do |line|
      expect do
        JSON.parse(line)
      end.not_to raise_error

      json = JSON.parse(line)
      expect(json.keys.sort).to eq %w{time cpu disk net}.sort
    end
  end

  it "should play plain pgr file" do
    busy100 = data_file "busy100.pgr"
    cmd = "#{perfmonger_bin} play #{busy100}"
    run(cmd)
    expect(last_command_started).to be_successfully_executed
    expect(last_command_started.stdout).to eq File.read(data_file "busy100.pgr.played")
  end

  it "should play plain gzipped file" do
    busy100 = data_file "busy100.pgr.gz"
    cmd = "#{perfmonger_bin} play #{busy100}"
    run(cmd)
    expect(last_command_started).to be_successfully_executed
    expect(last_command_started.stdout).to eq File.read(data_file "busy100.pgr.played")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
perfmonger-0.10.2 spec/play_spec.rb
perfmonger-0.10.1 spec/play_spec.rb