![]() ![]() In most programming languages, we would accomplish this by assigning the count to a variable and then updating the value each time a new bad guy is defeated. If we’re writing a video game, one of its states might be a count of the number of bad guys that have been defeated. State is how we make programs do non-trivial things. I’ll start out with a solution that’s too simple to be useful. A few months ago I wrote about storing state in erlang with processes and I thought it would be an interesting exercise to convert that discussion to Elixir. I’m still learning, and one thing that helps me learn new languages is to take a problem I’ve solved in another language and solve it in the new language. A good integration test suite can help you work out usability issues with your API, give you confidence that your deployment is stable, and provide a springboard for troubleshooting issues down the road. ![]() Introduction (plus a little discourse on testing) I like integration-level testing, especially for web apps and doubly so for APIs. #CHANGE AQUAMACS THEME CODE#The source code corresponding to this post is on my github at. TL DR To do integration testing in Phoenix, first enable the app’s content serving in its config, then use an HTTP client library (I use HTTPoison below) to make requests. Integration Testing a JSON API in Phoenix This is the place to put your OTP applications’ configuration in addition to configuration for system applications like the logger and sasl. I also talk a little about how you could use this to deploy Elixir projects using Chef.Įrlang’s sys.config Erlang releases use a file called sys.config for configuration values. This post describes Erlang’s sys.config and the equivalent config.exs in Elixir and how you can convert from config.exs to sys.config (the link is to a script that does this). Of 1 Generating an Erlang sys.config from an Elixir config.exs ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |