spec/models/rspeed/observer/after_spec.rb in rspeed-0.5.1 vs spec/models/rspeed/observer/after_spec.rb in rspeed-0.5.2

- old
+ new

@@ -4,13 +4,15 @@ let!(:now) { Time.local(2020, 1, 1, 0, 0, 1) } let!(:clock) { class_double(RSpec::Core::Time, now: now) } let!(:metadata) { { file_path: 'file_path', line_number: 7, start_at: now - 1 } } let!(:example) { instance_double(RSpec::Core::Example, clock: clock, metadata: metadata) } - before { truncate_file } + before { truncate_profiles } - it 'appends the time of example on csv file' do + it 'appends the file and time on pipe profile key' do described_class.after(example) - expect(File.open('rspeed.csv').read).to eq "1.0,file_path:7\n" + expect(RSpeed::Redis.client.lrange(RSpeed::Variable.profile, 0, -1)).to eq [ + { file: 'file_path:7', time: 1.0 }.to_json, + ] end end