Skip to content

Instantly share code, notes, and snippets.

@baweaver
Created January 16, 2014 05:30
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 baweaver/8450274 to your computer and use it in GitHub Desktop.
Save baweaver/8450274 to your computer and use it in GitHub Desktop.
Testing library: Proof. Vague musings on structure.
def my_function(n); n / 2; end
prove x.will eq(5).when { x = my_function(10) }
when { x = my_function(10) }.prove_that_it_will eq(5)
my_context = ->{ x = my_function(10) }
prove(x).will eq(5).when my_context
when(&:my_context).prove_that_it_will eq(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment