spec/feedjira/preprocessor_spec.rb in feedjira-2.2.0 vs spec/feedjira/preprocessor_spec.rb in feedjira-3.0.0.beta1
- old
+ new
@@ -1,29 +1,29 @@
-require 'spec_helper'
+require "spec_helper"
describe Feedjira::Preprocessor do
- it 'returns the xml as parsed by Nokogiri' do
- xml = '<xml></xml>'
+ it "returns the xml as parsed by Nokogiri" do
+ xml = "<xml></xml>"
doc = Nokogiri::XML(xml).remove_namespaces!
processor = Feedjira::Preprocessor.new xml
escaped = processor.to_xml
expect(escaped).to eq doc.to_xml
end
- it 'escapes markup in xhtml content' do
+ it "escapes markup in xhtml content" do
processor = Feedjira::Preprocessor.new sample_atom_xhtml_feed
escaped = processor.to_xml
escaped_parts = escaped.split "\n"
expect(escaped_parts[10]).to match(%r{<i>dogs</i>}) # title
expect(escaped_parts[16]).to match(%r{<b>XHTML</b>}) # summary
expect(escaped_parts[26]).to match(/<p>$/) # content
end
- it 'leaves escaped html within pre tag' do
+ it "leaves escaped html within pre tag" do
processor = Feedjira::Preprocessor.new(sample_atom_xhtml_with_escpaed_html_in_pre_tag_feed) # rubocop:disable Metrics/LineLength
escaped = processor.to_xml
- expected_pre_tag = ' <pre>&lt;b&gt;test&lt;b&gt;</pre>' # rubocop:disable Metrics/LineLength
+ expected_pre_tag = " <pre>&lt;b&gt;test&lt;b&gt;</pre>" # rubocop:disable Metrics/LineLength
expect(escaped.split("\n")[7]).to eq(expected_pre_tag)
end
end