New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctests for basic agent functionality #5583

Merged
merged 2 commits into from Dec 22, 2016

Conversation

Projects
None yet
3 participants
@PragTob
Contributor

PragTob commented Dec 22, 2016

Read the docs and thought it'd be nice to have usage examples
right there so why not make it doc tests :)

It's a bit repetetive as you always need to start the agent and
I figured even for start/start_link it'd be nice to show that
the value now lives there but that might be discussion worthy.

I also started out always calling Agent.stop to stop the agent
(the other agent tests do that) but the GenServer tests don't
seem to shut it down every time so I thought it might be okay
here in favor of less clutter and to have more clarity :)

Happy about feedback!

Doctests for basic agent functionality
Read the docs and thought it'd be nice to have usage examples
right there so why not make it doc tests :)

It's a bit repetetive as you always need to start the agent and
I figured even for start/start_link it'd be nice to show that
the value now lives there but that might be discussion worthy.

I also started out always calling Agent.stop to stop the agent
(the other agent tests do that) but the GenServer tests don't
seem to shut it down every time so I thought it might be okay
here in favor of less clutter and to have more clarity :)
Review Feedback
* black line between use and doctest
* parentheses for method calls
@PragTob

This comment has been minimized.

Show comment
Hide comment
@PragTob

PragTob Dec 22, 2016

Contributor

Updated :) Thanks for the review!

Contributor

PragTob commented Dec 22, 2016

Updated :) Thanks for the review!

@lexmag lexmag merged commit 272797d into elixir-lang:master Dec 22, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@lexmag

This comment has been minimized.

Show comment
Hide comment
@lexmag

lexmag Dec 22, 2016

Member

Thank you @PragTob. 💛

Member

lexmag commented Dec 22, 2016

Thank you @PragTob. 💛

@PragTob PragTob deleted the PragTob:agent-doctests branch Dec 23, 2016

AndrewDryga added a commit to AndrewDryga/elixir that referenced this pull request Jan 28, 2017

ckampfe added a commit to ckampfe/elixir that referenced this pull request Jul 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment