Let's extract the @driver.get site into a method openSite in "buy_book.rb". An it should look like:
@driver.get site
openSite
Given /^I open "(.*?)"$/ do |site| openSite (site) end def openSite (site) @driver.get site end
def openSite (site) @driver.get site end