Testing HTTP in Elixir with ExVCR

Studying Elixir, I decided to write a client for an existing API and I wanted to do it in the correct way™: writing a complete test coverage.
My choice was to use HTTPoison (since I like Poison for JSON parsing) and ExVCR to write the API tests.

So, what is ExVCR? If you come from the Rails land, it’s the Elixir version of VCR, it:
“Record and replay HTTP interactions library for elixir. It’s inspired by Ruby’s VCR, and trying to provide similar functionalities.”
It allows you to make API calls and record those on “cassettes”, allowing you to replay the recordings at every test run, decoupling the test phase from the API server and permitting offline tests.

Continue reading “Testing HTTP in Elixir with ExVCR”

A little story about brew, Firefox 47, Selenium and Capybara

I am quite a big fan of brew and brew cask. I switched from Linux to OSX less than a year ago and both of them gave me immediately the feel of being at home with a “standardized” way to handle the installation of applications on my system.

Yes, I know there are different conflicting opinions regarding how brew works under the hood like where it puts the installed applications, how it symlinks them and how it handles different app versions. Sincerely I never paid much attention to these discussions (my bad). For me it works quite well as it gives me the feel to have an organized and clean system.

Personally I also like to have my system steadily up-to-date and to achieve this goal I constantly use a brew update everything command that I built (or found?…sorry, I don’t remember XD) which automatically updates all the applications, “CLI and GUI based”, I’ve installed:

brew update && brew upgrade && brew cask list | xargs brew cask install --force && brew cleanup --force && brew cask cleanup --force

What it does is to update both brew and brew cask repositories, upgrade the installed applications (again, “CLI and GUI based”) and then do a cleanup by removing the old version of the applications.

Launching this command is quite disruptive considering that it forces the removal of the old version of the apps. So I do not feel like recommend it unless you’re able to handle some occasional problems.

A few days ago I ran indeed in one of these problems.

Continue reading “A little story about brew, Firefox 47, Selenium and Capybara”