require 'spec_helper' describe Marksman::Writer do it 'should call write on the converter' do converter = double(Marksman::Converter) presentation = Marksman::Parser.new.parse('spec/data/example.md') expect(Marksman::Converter).to receive(:new).with(presentation).and_return(converter) expect(converter).to receive(:write).with('output') Marksman::Writer.new('spec/data/example.md', 'output').generate end end