require 'spec_helper' class TestSaver include Trackman::Scaffold::ContentSaver def self.clean self.nodes_to_remove = {} self.nodes_to_edit = {} end end describe Trackman::Scaffold::ContentSaver do before :all do @saver = TestSaver.new end after :each do TestSaver.clean end it "removes the a with an abc href" do TestSaver.remove('a'){ |n| n['href'].include? 'abc' } html = " " doc = Nokogiri::HTML(html) @saver.send(:remove_nodes, doc) actual = doc.to_s actual.should_not include('abc') actual.should include('/hello') actual.should include('world') end it "removes the a with an abc href" do TestSaver.remove 'a' TestSaver.remove '.bobby' html = "

allo

" doc = Nokogiri::HTML(html) @saver.send(:remove_nodes, doc) actual = doc.to_s actual.should_not include('