Sha256: 0257278aa43c8daecbe534556ccee89f78002b47055a8d985984e7c06b2c5c3d

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

RSpec.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

10 entries across 10 versions & 1 rubygems

Version Path
perfmonger-0.14.4 spec/play_spec.rb
perfmonger-0.14.2 spec/play_spec.rb
perfmonger-0.14.1 spec/play_spec.rb
perfmonger-0.14.0 spec/play_spec.rb
perfmonger-0.13.1 spec/play_spec.rb
perfmonger-0.12.1 spec/play_spec.rb
perfmonger-0.12.0 spec/play_spec.rb
perfmonger-0.11.2 spec/play_spec.rb
perfmonger-0.11.1 spec/play_spec.rb
perfmonger-0.11.0 spec/play_spec.rb