Sha256: d76bb4ebf2da9056b30cc5ef6ff0b9fb0e117e0a1fb1e7d0def086ec0e01d96a

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true

RSpec.describe RSpeed::Splitter, '#rename' do
  subject(:splitter) { described_class.new }

  let!(:redis) { redis_object }

  before do
    redis.lpush('rspeed', 'rspeed_content')

    redis.lpush('rspeed_profile_1', { file: '1_spec.rb', time: 1.0 }.to_json)
    redis.lpush('rspeed_profile_2', { file: '2_spec.rb', time: 2.0 }.to_json)
    redis.lpush('rspeed_profile_3', { file: '3_spec.rb', time: 3.0 }.to_json)
  end

  it 'copies profiles to the result key cleanning the previous result' do
    splitter.rename

    expect(redis.lrange('rspeed', 0, -1)).to eq [
      '{"file":"1_spec.rb","time":1.0}',
      '{"file":"2_spec.rb","time":2.0}',
      '{"file":"3_spec.rb","time":3.0}',
    ]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspeed-0.5.2 spec/models/rspeed/splitter/rename_spec.rb