I'm using Cucumber with a page object similar to the simplified version shown below. I need to do some quite complex parsing of the HTML, so I'd like to be able to unit test the page object in isolation using RSpec against an HTML fixture, but I'm a bit stuck about to do this. I'm guessing that I need to stub something in Capybara, and pass it in as a dependency?
class SomePage def header session.find('h1').text end def title session.find('title').text end private def session @session ||= Capybara.current_session end end