File: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/roadie-4.0.0/spec/shared_examples/url_rewriter.rb
# frozen_string_literal: true
shared_examples_for "url rewriter" do
it "is constructed with a generator" do
generator = double "URL generator"
expect {
described_class.new(generator)
}.to_not raise_error
end
it "has a #transform_dom(dom) method that returns the modified string" do
expect(subject).to respond_to(:transform_dom)
expect(subject.method(:transform_dom).arity).to eq(1)
dom = Nokogiri::HTML.parse "<body></body>"
expect(subject.transform_dom(dom)).to be_nil
end
it "has a #transform_css(css) method that returns the modified string" do
expect(subject).to respond_to(:transform_css)
expect(subject.method(:transform_css).arity).to eq(1)
expect(subject.transform_css("")).to eq("")
end
end