Skip to content

Instantly share code, notes, and snippets.

@michael-harrison
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michael-harrison/9905382 to your computer and use it in GitHub Desktop.
Save michael-harrison/9905382 to your computer and use it in GitHub Desktop.
RSpec Test Patterns
# Test the existance of a file after a method call
it('will create a file') do
expect { subject.create_the_file }.to change { File.exists? my_file }.from(false).to(true)
end
it('will do something') do
expect { subject.instance_eval { my_private_method } }.to be_true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment