You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/spec/services/asciicast_processor_spec.rb

33 lines
828 B
Ruby

require 'rails_helper'
describe AsciicastProcessor do
let(:processor) { described_class.new }
describe '#process' do
let(:asciicast) { double('asciicast') }
let(:snapshot_updater) { double('snapshot_updater', :update => nil) }
let(:frames_file_updater) { double('frames_file_updater', :update => nil) }
subject { processor.process(asciicast) }
before do
allow(AsciicastSnapshotUpdater).to receive(:new) { snapshot_updater }
allow(AsciicastFramesFileUpdater).to receive(:new) { frames_file_updater }
end
it 'generates a snapshot' do
subject
expect(snapshot_updater).to have_received(:update).with(asciicast)
end
it 'generates animation frames' do
subject
expect(frames_file_updater).to have_received(:update).with(asciicast)
end
end
end