Skip to content

Instantly share code, notes, and snippets.

@emilybache
Last active December 17, 2015 19:38
Show Gist options
  • Save emilybache/5661323 to your computer and use it in GitHub Desktop.
Save emilybache/5661323 to your computer and use it in GitHub Desktop.
I'm having trouble getting started with approval testing in ruby, I can't find any documentation, and I can't seem to make sense of the source code. I'd really appreciate some help getting this code to run.
require 'approvals'
require 'approvals/rspec'
Approvals.configuration.approvals_path = './'
def answer
42
end
require './spec_helper'
require './untitled'
describe "untitled" do
context "when doing sums" do
it "multiplies correctly" do
Approvals.verify(answer, :name => "untitled_test")
end
end
subject do
answer
end
it "works" do
approve do
subject
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment