require "pry" Given /^the facebook post:$/ do |json_post| @post = JSON.parse json_post end And /^the viewer:$/ do |json_viewer| @viewer = JSON.parse json_viewer end When /^I convert it into schema\.org\/Article\/Small$/ do @translated = Fetcher::Microdata::ArticleSmall.new :facebook, @post, @viewer end Then /^I should have post:$/ do |string| @schema = JSON.parse string @translated.to.hash.should == @schema end