Eli Sarver

All Categories: golang(1) go(1) home

Me and F/OSS

I thought it would be a fun experiment to list the tools I work with on (at least) a daily basis at work:

  • Selenium WebDriver
  • RSpec
  • Cucumber
  • Ruby
  • Linux
  • Vagrant
  • Git
  • Subversion

These tools all have one very important thing in common: they are F/OSS. I've recently been doing some soul-searching about what that really means to me.

As a . . .

Read More

February 02, 2014

I block ads

You should, too. (but whitelist sites that respect you)

I block ads because they abuse my trust and privacy and generally assault my senses. Hyperbolic? Not really.

If you can slot without offending visitors to your site, do it. Respect trust, respect privacy, and serve clean ads. Here's a few examples of how to do it right:

Read More

January 20, 2014

Currently reading

November 2013

I'm working my way through both Avdi Grimm's Exceptional Ruby and 'Kestrels, Quirky Birds and Hopeless Egocentricity' by Reginald Braithwaite (aka raganwald).

The former is about handling exceptions in Ruby with grace, even preventing them in some case. The latter is about a crazy thing called a combinator, which is a . . .

Read More

November 20, 2013

Writing steps right

Subtleties of Cucumber test definitions

The task: write a test step that verifies an image is in the correct aspect ratio. On our first pass, we can:

  1. verify exact pixel dimensions
  2. check the request url for an aspect in the request
  3. assert the proportions of the actual image

Exact pixel dimensions

Then /^the image dimensions are (\d+) by (\d+)$/ do |width, height| expect( . . .

Read More

October 16, 2013


for tests that use cookies

I have a test suite that currently takes 4:30 to run, and I guessed that it's the browser slowing it down. My tests use cucumber, so these hooks take care of stateful tests while cutting down time to run for every other test:

Before('@stateful') do |scenario| kill_browser end After('@stateful') do |scenario| kill_browser  . . .

Read More

October 10, 2013


Lists are your friend.

Guava is a time saver. I was reviewing some code, and came across the following method:

protected List<Map<String, Object>[]> buildPages(List<Map<String, Object>> articles, Integer perPage) { int index = 0; Map<String,Object>[] page = null; for (Map<String, Object> a : articles) { if(index == 0) { page =  . . .

Read More

October 09, 2013

From Complex to Simple Tests

or, how I learned to get big reuse out of small methods.

Two years ago, I ended up creating a functional test codebase that took at its peak four hours to run. Considering we had over 1500 tests, this seems reasonable, but the tests were fragile in several ways.

  • Since we were relying on data, tests could become fragile or have race conditions.
  • Database reads reflect present . . .

Read More

September 30, 2013


All Categories: golang(1) go(1) home