Eli Sarver

All Categories: go(1) gokit.io(1) golang(1) home

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 (\ . . .

Read More

October 16, 2013

@stateful

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 | . . .

Read More

October 10, 2013

Guava

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 . . .

Read More

October 09, 2013

From Complex to Simple Tests

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

rube_goldberg.java

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 . . .

Read More

September 30, 2013

Go!

The more I research languages for my personal enrichment, the more I like Go.

For one thing, their documentation is excellent. They explain not only how Go works, but also why. The FAQ is great to get your feet wet, but clearly the best document is Effective Go, which explains go's idioms in detail.

godoc is likewise . . .

Read More

August 01, 2013

Tending to the Wounded

(amplifier)

I recently found a 1993 Now Hear This! SW2Pi 10" sub and the accompanying amplifier, the 200w SA-2 from Craig's List. It had a problem, according to its previous owner. It basically had an 'unmusical' sound when connected via its RCA inputs. This makes it a great deal if I can fix it and integrate it into my system, so I . . .

Read More

June 07, 2013

All Categories: go(1) gokit.io(1) golang(1) home

This update link alerts you to new Silvrback admin blog posts. A green bubble beside the link indicates a new post. Click the link to the admin blog and the bubble disappears.

Got It!