Sha256: 095e9b04862fff8623b31e6b196b6f10112034bd7d3c37f4973f2fb207a05d7a
Contents?: true
Size: 859 Bytes
Versions: 1
Compression:
Stored size: 859 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe AutoHtml::SimpleFormat do it 'formats input using simple rules' do result = subject.call('Hey check out my blog => https://example.org') expect(result).to eq '<p>Hey check out my blog => https://example.org</p>' expect(subject.call("crazy\r\n cross\r platform linebreaks")).to eq "<p>crazy\n<br /> cross\n<br /> platform linebreaks</p>" expect(subject.call("A paragraph\n\nand another one!")).to eq "<p>A paragraph</p>\n\n<p>and another one!</p>" expect(subject.call("A paragraph\n With a newline")).to eq "<p>A paragraph\n<br /> With a newline</p>" expect(subject.call("A\nB\nC\nD")).to eq "<p>A\n<br />B\n<br />C\n<br />D</p>" expect(subject.call("A\r\n \nB\n\n\r\n\t\nC\nD")).to eq "<p>A\n<br /> \n<br />B</p>\n\n<p>\t\n<br />C\n<br />D</p>" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
auto_html-2.2.0 | spec/auto_html/simple_format_spec.rb |