Sha256: 1d78b363cffe75d753b57eb7d08389508adb3779e1dc44fdcb033b3ccdef782e
Contents?: true
Size: 927 Bytes
Versions: 2
Compression:
Stored size: 927 Bytes
Contents
require 'spec_helper' describe 'Document' do it 'should raise exception on invalid input file' do proc { Docify::Document.new('qwe123')}.should raise_error ArgumentError, "File [qwe123] does not exist!" proc { Docify::Document.new('/tmp') }.should raise_error ArgumentError, "File required!" end it 'should render correct layout' do doc = Docify::Document.new('README.rdoc') output = doc.render('rdoc') output.should match(/<meta http-equiv="Content-Type" content="text\/html; charset=UTF-8" \/>/) output.should match(/<title>README.rdoc<\/title>/) end it 'should raise an exception on invalid output path' do doc = Docify::Document.new('README.rdoc') doc.render('rdoc') proc { doc.save_to('~/blah') }.should raise_error ArgumentError, "Output path does not exist!" proc { doc.save_to('/tmp') }.should raise_error ArgumentError, "Output path should be a file!" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
docify-1.0.2 | spec/document_spec.rb |
docify-1.0.1 | spec/document_spec.rb |