{"action":"created","comment":{"url":"https://api.github.com/repos/doomspork/elixir-school/pulls/comments/69291647","id":69291647,"diff_hunk":"@@ -0,0 +1,107 @@\n+---\n+layout: page\n+title: Tests\n+category: basics\n+order: 12\n+lang: fr\n+---\n+\n+Faire des tests est une partie importante du développement informatique. Dans cette leçon, nous allons voir comment tester notre code Elixir avec ExUnit ainsi que les bonnes pratiques pour cela.\n+\n+{% include toc.html %}\n+\n+## ExUnit\n+\n+L'outil de test intégré dans Elixir est ExUnit et il contient tout ce qu'il faut pour tester rigoureusement le code.  Avant de continuer, il est important de noter que les tests sont implémentés comme tout script Elixir donc nous utilisons l'éxtension `.exs`.  Avant de pouvoir lancer nos tests, il nous faut démarrer ExUnit avec `ExUnit.start()` que l'on place généralement dans `test/test_helper.exs`.\n+\n+Quand nous avons généré notre projet d'éxemple dans la leçon précédente, mix nous a aidé en créant un test simple que nous pouvons trouver dans `test/example_test.exs`:\n+\n+```elixir\n+defmodule ExampleTest do\n+  use ExUnit.Case\n+  doctest Example\n+\n+  test \"the truth\" do\n+    assert 1 + 1 == 2\n+  end\n+end\n+```\n+\n+Nous pouvons alors lançer les tests de notre projet avec `mix test`.  Si nous éxécutons cela maintenant, nous devrions afficher une sortie similaire à la suivante:\n+\n+```shell\n+Finished in 0.03 seconds (0.02s on load, 0.01s on tests)\n+1 tests, 0 failures\n+```\n+\n+### assert\n+\n+Si vous avez déjà ecrit des tests auparavant, vous êtes certainement habitué à `assert`; dans certains frameworks `should` ou `expect` prend la place de `assert`.","path":"fr/lessons/basics/testing.md","position":39,"original_position":39,"commit_id":"30f02064810d15487663511230395cbe4c4ab577","original_commit_id":"30f02064810d15487663511230395cbe4c4ab577","user":{"login":"julienXX","id":53949,"avatar_url":"https://avatars.githubusercontent.com/u/53949?v=3","gravatar_id":"","url":"https://api.github.com/users/julienXX","html_url":"https://github.com/julienXX","followers_url":"https://api.github.com/users/julienXX/followers","following_url":"https://api.github.com/users/julienXX/following{/other_user}","gists_url":"https://api.github.com/users/julienXX/gists{/gist_id}","starred_url":"https://api.github.com/users/julienXX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienXX/subscriptions","organizations_url":"https://api.github.com/users/julienXX/orgs","repos_url":"https://api.github.com/users/julienXX/repos","events_url":"https://api.github.com/users/julienXX/events{/privacy}","received_events_url":"https://api.github.com/users/julienXX/received_events","type":"User","site_admin":false},"body":"ecrit -> écrit, habitué -> habitués, prend -> prennent","created_at":"2016-07-01T12:25:13Z","updated_at":"2016-07-01T12:25:13Z","html_url":"https://github.com/doomspork/elixir-school/pull/482#discussion_r69291647","pull_request_url":"https://api.github.com/repos/doomspork/elixir-school/pulls/482","_links":{"self":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/comments/69291647"},"html":{"href":"https://github.com/doomspork/elixir-school/pull/482#discussion_r69291647"},"pull_request":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/482"}}},"pull_request":{"url":"https://api.github.com/repos/doomspork/elixir-school/pulls/482","id":75962945,"html_url":"https://github.com/doomspork/elixir-school/pull/482","diff_url":"https://github.com/doomspork/elixir-school/pull/482.diff","patch_url":"https://github.com/doomspork/elixir-school/pull/482.patch","issue_url":"https://api.github.com/repos/doomspork/elixir-school/issues/482","number":482,"state":"open","locked":false,"title":"Add french translation for testing lesson","user":{"login":"mikaoelitiana","id":674667,"avatar_url":"https://avatars.githubusercontent.com/u/674667?v=3","gravatar_id":"","url":"https://api.github.com/users/mikaoelitiana","html_url":"https://github.com/mikaoelitiana","followers_url":"https://api.github.com/users/mikaoelitiana/followers","following_url":"https://api.github.com/users/mikaoelitiana/following{/other_user}","gists_url":"https://api.github.com/users/mikaoelitiana/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaoelitiana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaoelitiana/subscriptions","organizations_url":"https://api.github.com/users/mikaoelitiana/orgs","repos_url":"https://api.github.com/users/mikaoelitiana/repos","events_url":"https://api.github.com/users/mikaoelitiana/events{/privacy}","received_events_url":"https://api.github.com/users/mikaoelitiana/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-01T10:59:49Z","updated_at":"2016-07-01T12:25:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d1ba2aebdf20e57ea99214960f37012954926fb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/doomspork/elixir-school/pulls/482/commits","review_comments_url":"https://api.github.com/repos/doomspork/elixir-school/pulls/482/comments","review_comment_url":"https://api.github.com/repos/doomspork/elixir-school/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doomspork/elixir-school/issues/482/comments","statuses_url":"https://api.github.com/repos/doomspork/elixir-school/statuses/30f02064810d15487663511230395cbe4c4ab577","head":{"label":"mikaoelitiana:translate-basic-testings","ref":"translate-basic-testings","sha":"30f02064810d15487663511230395cbe4c4ab577","user":{"login":"mikaoelitiana","id":674667,"avatar_url":"https://avatars.githubusercontent.com/u/674667?v=3","gravatar_id":"","url":"https://api.github.com/users/mikaoelitiana","html_url":"https://github.com/mikaoelitiana","followers_url":"https://api.github.com/users/mikaoelitiana/followers","following_url":"https://api.github.com/users/mikaoelitiana/following{/other_user}","gists_url":"https://api.github.com/users/mikaoelitiana/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaoelitiana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaoelitiana/subscriptions","organizations_url":"https://api.github.com/users/mikaoelitiana/orgs","repos_url":"https://api.github.com/users/mikaoelitiana/repos","events_url":"https://api.github.com/users/mikaoelitiana/events{/privacy}","received_events_url":"https://api.github.com/users/mikaoelitiana/received_events","type":"User","site_admin":false},"repo":{"id":62376424,"name":"elixir-school","full_name":"mikaoelitiana/elixir-school","owner":{"login":"mikaoelitiana","id":674667,"avatar_url":"https://avatars.githubusercontent.com/u/674667?v=3","gravatar_id":"","url":"https://api.github.com/users/mikaoelitiana","html_url":"https://github.com/mikaoelitiana","followers_url":"https://api.github.com/users/mikaoelitiana/followers","following_url":"https://api.github.com/users/mikaoelitiana/following{/other_user}","gists_url":"https://api.github.com/users/mikaoelitiana/gists{/gist_id}","starred_url":"https://api.github.com/users/mikaoelitiana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikaoelitiana/subscriptions","organizations_url":"https://api.github.com/users/mikaoelitiana/orgs","repos_url":"https://api.github.com/users/mikaoelitiana/repos","events_url":"https://api.github.com/users/mikaoelitiana/events{/privacy}","received_events_url":"https://api.github.com/users/mikaoelitiana/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikaoelitiana/elixir-school","description":"Lessons about the Elixir programming language","fork":true,"url":"https://api.github.com/repos/mikaoelitiana/elixir-school","forks_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/forks","keys_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/teams","hooks_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/hooks","issue_events_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/issues/events{/number}","events_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/events","assignees_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/assignees{/user}","branches_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/branches{/branch}","tags_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/tags","blobs_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/statuses/{sha}","languages_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/languages","stargazers_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/stargazers","contributors_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/contributors","subscribers_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/subscribers","subscription_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/subscription","commits_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/contents/{+path}","compare_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/merges","archive_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/downloads","issues_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/issues{/number}","pulls_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/pulls{/number}","milestones_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/milestones{/number}","notifications_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/labels{/name}","releases_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/releases{/id}","deployments_url":"https://api.github.com/repos/mikaoelitiana/elixir-school/deployments","created_at":"2016-07-01T08:10:42Z","updated_at":"2016-07-01T08:10:45Z","pushed_at":"2016-07-01T10:57:26Z","git_url":"git://github.com/mikaoelitiana/elixir-school.git","ssh_url":"git@github.com:mikaoelitiana/elixir-school.git","clone_url":"https://github.com/mikaoelitiana/elixir-school.git","svn_url":"https://github.com/mikaoelitiana/elixir-school","homepage":"https://elixirschool.com","size":1969,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"doomspork:master","ref":"master","sha":"2d06d0de51bf59add193d0db81f23a0716fa1755","user":{"login":"doomspork","id":73386,"avatar_url":"https://avatars.githubusercontent.com/u/73386?v=3","gravatar_id":"","url":"https://api.github.com/users/doomspork","html_url":"https://github.com/doomspork","followers_url":"https://api.github.com/users/doomspork/followers","following_url":"https://api.github.com/users/doomspork/following{/other_user}","gists_url":"https://api.github.com/users/doomspork/gists{/gist_id}","starred_url":"https://api.github.com/users/doomspork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doomspork/subscriptions","organizations_url":"https://api.github.com/users/doomspork/orgs","repos_url":"https://api.github.com/users/doomspork/repos","events_url":"https://api.github.com/users/doomspork/events{/privacy}","received_events_url":"https://api.github.com/users/doomspork/received_events","type":"User","site_admin":false},"repo":{"id":36616176,"name":"elixir-school","full_name":"doomspork/elixir-school","owner":{"login":"doomspork","id":73386,"avatar_url":"https://avatars.githubusercontent.com/u/73386?v=3","gravatar_id":"","url":"https://api.github.com/users/doomspork","html_url":"https://github.com/doomspork","followers_url":"https://api.github.com/users/doomspork/followers","following_url":"https://api.github.com/users/doomspork/following{/other_user}","gists_url":"https://api.github.com/users/doomspork/gists{/gist_id}","starred_url":"https://api.github.com/users/doomspork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doomspork/subscriptions","organizations_url":"https://api.github.com/users/doomspork/orgs","repos_url":"https://api.github.com/users/doomspork/repos","events_url":"https://api.github.com/users/doomspork/events{/privacy}","received_events_url":"https://api.github.com/users/doomspork/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/doomspork/elixir-school","description":"Lessons about the Elixir programming language","fork":false,"url":"https://api.github.com/repos/doomspork/elixir-school","forks_url":"https://api.github.com/repos/doomspork/elixir-school/forks","keys_url":"https://api.github.com/repos/doomspork/elixir-school/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doomspork/elixir-school/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doomspork/elixir-school/teams","hooks_url":"https://api.github.com/repos/doomspork/elixir-school/hooks","issue_events_url":"https://api.github.com/repos/doomspork/elixir-school/issues/events{/number}","events_url":"https://api.github.com/repos/doomspork/elixir-school/events","assignees_url":"https://api.github.com/repos/doomspork/elixir-school/assignees{/user}","branches_url":"https://api.github.com/repos/doomspork/elixir-school/branches{/branch}","tags_url":"https://api.github.com/repos/doomspork/elixir-school/tags","blobs_url":"https://api.github.com/repos/doomspork/elixir-school/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doomspork/elixir-school/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doomspork/elixir-school/git/refs{/sha}","trees_url":"https://api.github.com/repos/doomspork/elixir-school/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doomspork/elixir-school/statuses/{sha}","languages_url":"https://api.github.com/repos/doomspork/elixir-school/languages","stargazers_url":"https://api.github.com/repos/doomspork/elixir-school/stargazers","contributors_url":"https://api.github.com/repos/doomspork/elixir-school/contributors","subscribers_url":"https://api.github.com/repos/doomspork/elixir-school/subscribers","subscription_url":"https://api.github.com/repos/doomspork/elixir-school/subscription","commits_url":"https://api.github.com/repos/doomspork/elixir-school/commits{/sha}","git_commits_url":"https://api.github.com/repos/doomspork/elixir-school/git/commits{/sha}","comments_url":"https://api.github.com/repos/doomspork/elixir-school/comments{/number}","issue_comment_url":"https://api.github.com/repos/doomspork/elixir-school/issues/comments{/number}","contents_url":"https://api.github.com/repos/doomspork/elixir-school/contents/{+path}","compare_url":"https://api.github.com/repos/doomspork/elixir-school/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doomspork/elixir-school/merges","archive_url":"https://api.github.com/repos/doomspork/elixir-school/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doomspork/elixir-school/downloads","issues_url":"https://api.github.com/repos/doomspork/elixir-school/issues{/number}","pulls_url":"https://api.github.com/repos/doomspork/elixir-school/pulls{/number}","milestones_url":"https://api.github.com/repos/doomspork/elixir-school/milestones{/number}","notifications_url":"https://api.github.com/repos/doomspork/elixir-school/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doomspork/elixir-school/labels{/name}","releases_url":"https://api.github.com/repos/doomspork/elixir-school/releases{/id}","deployments_url":"https://api.github.com/repos/doomspork/elixir-school/deployments","created_at":"2015-05-31T18:27:42Z","updated_at":"2016-07-01T08:10:40Z","pushed_at":"2016-07-01T10:59:49Z","git_url":"git://github.com/doomspork/elixir-school.git","ssh_url":"git@github.com:doomspork/elixir-school.git","clone_url":"https://github.com/doomspork/elixir-school.git","svn_url":"https://github.com/doomspork/elixir-school","homepage":"https://elixirschool.com","size":2475,"stargazers_count":524,"watchers_count":524,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":172,"mirror_url":null,"open_issues_count":52,"forks":172,"open_issues":52,"watchers":524,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/482"},"html":{"href":"https://github.com/doomspork/elixir-school/pull/482"},"issue":{"href":"https://api.github.com/repos/doomspork/elixir-school/issues/482"},"comments":{"href":"https://api.github.com/repos/doomspork/elixir-school/issues/482/comments"},"review_comments":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/482/comments"},"review_comment":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doomspork/elixir-school/pulls/482/commits"},"statuses":{"href":"https://api.github.com/repos/doomspork/elixir-school/statuses/30f02064810d15487663511230395cbe4c4ab577"}}}}
{"actor":{"display_login":"julienXX"}}