Skip to content

Instantly share code, notes, and snippets.

@mcquin
Created March 2, 2016 18:01
Show Gist options
  • Save mcquin/12e95bdd0769084f6824 to your computer and use it in GitHub Desktop.
Save mcquin/12e95bdd0769084f6824 to your computer and use it in GitHub Desktop.

~/.atom/snippets.cson

## Erlang
'.source.erlang':
    'HoaxMock Directive':
        'prefix': 'hmock'
        'body': """
            hoax:mock($1,
                      ?expect($2,
                              ?withArgs([$3]),
                              ?andReturn($4))),$5
        """
    'HoaxMockList Directive':
        'prefix': 'hmockl'
        'body': """
            hoax:mock($1,
                [
                      $2
                ]),$3
        """
    'HoaxMockExpect Directive':
        'prefix': 'hexpect'
        'body': """
            ?expect($1,
                    ?withArgs([$3]),
                    ?andReturn($4)),$5
        """
    'HoaxFixtureTest Directive':
        'prefix': 'fixtest'
        'body': """
            $1_fixture_test_() ->
                hoax:fixture(?MODULE, "$1", $2, $3).$4
        """
    'HoaxParameterizedFixtureTest Directive':
        'prefix': 'fixtestp'
        'body': """
            $1_parameterized_fixture_test_() ->
                hoax:parameterized_fixture(?MODULE, "$1", $2, $3).$4
        """
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment