Last active
August 29, 2015 13:57
-
-
Save michael-harrison/9905382 to your computer and use it in GitHub Desktop.
RSpec Test Patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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