Skip to content

Instantly share code, notes, and snippets.

@bill-transue
Created May 30, 2013 14:24
Show Gist options
  • Save bill-transue/5678234 to your computer and use it in GitHub Desktop.
Save bill-transue/5678234 to your computer and use it in GitHub Desktop.
Is this dumb?
shared_examples_for 'a contact' do |options={}|
it { should be_a(Contact) }
its(:first_name) { should ==(first_name) }
its(:last_name) { should ==(last_name) }
its(:email) { should ==(email) }
unless options[:except_a_phone_number]
it "should scrape the phone number" do
subject.extended_contact_data_attributes[:phone_numbers].first[:value].should ==(phone_number)
end
end
end
describe ProcessorJob
context "of something without a phone number" do
subject { ProcessorJob...}
it_should_return 'a contact', :except_a_phone_number => true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment