Sha256: 8898463db06b96b78a5d3e728cfa5d4df7497d3e217f6bab68c590071d394f25
Contents?: true
Size: 1016 Bytes
Versions: 4
Compression:
Stored size: 1016 Bytes
Contents
require 'spec_helper' describe Bergamasco::Summarize do subject { Bergamasco::Summarize } it 'should truncate after 250 characters' do filepath = fixture_path + 'cool-dois-without-yml.md' file = IO.read(filepath) content = subject.summary(file) expect(content.length).to eq(250) expect(content).to start_with("In 1998 Tim Berners-Lee coined") end it 'should truncate after 75 characters' do filepath = fixture_path + 'cool-dois-without-yml.md' file = IO.read(filepath) content = subject.summary(file, length: 75) expect(content.length).to eq(83) expect(content).to start_with("In 1998 Tim Berners-Lee coined") end it 'should truncate at separator' do filepath = fixture_path + 'cool-dois-without-yml.md' file = IO.read(filepath) separator = "READMORE" content = subject.summary(file, separator: separator) expect(content).to start_with("In 1998 Tim Berners-Lee coined") expect(content).to end_with("the referenced resource.") end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
bergamasco-0.1.4 | spec/summarize_spec.rb |
bergamasco-0.1.3 | spec/summarize_spec.rb |
bergamasco-0.1.2 | spec/summarize_spec.rb |
bergamasco-0.1.1 | spec/summarize_spec.rb |