Skip to content

Instantly share code, notes, and snippets.

@aneyzberg
aneyzberg / pattern-matching-10.md
Last active April 8, 2018 12:23
Pattern Matching
iex(9)> Greeter.hello(:jane)
"Hello Jane"
iex(10)> Greeter.hello(:anna)
"Hello anna"

Keybase proof

I hereby claim:

  • I am aneyzberg on github.
  • I am aneyzberg (https://keybase.io/aneyzberg) on keybase.
  • I have a public key ASA31Muf_yj2taNLIy9SAMP1ezT2MkyerBF1M508SL7FPAo

To claim this, I am signing this object:

@aneyzberg
aneyzberg / Definitons of testting
Created December 7, 2014 03:36
Describing difference between different types of tests
Taken from stack overflow link - http://stackoverflow.com/questions/4904096/whats-the-difference-between-unit-functional-acceptance-and-integration-test
Depending on where you look, you'll get slightly different answers. I've read about the subject a lot, and here's my distillation; again, these are slightly wooly and others may disagree.
Unit Tests
Tests the smallest unit of functionality, typically a method/function (e.g. given a class with a particular state, calling x method on the class should cause y to happen). Unit tests should be focussed on one particular feature (e.g., calling the pop method when the stack is empty should throw an InvalidOperationException). Everything it touches should be done in memory; this means that the test code and the code under test shouldn't: