Img_1302-edit-edit_large

Eli Sarver

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

The dynamic test anti-pattern

Branching and configuration belie uncertainty.

Are your step definitions 10+ lines long? Are you relying too much on state to test? Do you get confused when you read your tests back?

I believe that opinionated specifications are the best tests. They focus in on detail and cut through lines of integration that make tests slow and brittle. They restrict degrees of freedom, making . . .

Read More

March 29, 2014

Quick RSS Validation

If you're using Ruby and RSpec with RSS you can save a lot of quick checking time by using functional programming.

After loading in the RSS feed, you can use the following transforms on the data:

def descriptions
 items.map(&:description)
end

def missing_any?(field_sym)
 fields = send(field_sym)
 . . .

Read More

February 04, 2014

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

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

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

Archive

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