Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Concurrent spec framework

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


Peck is a concurrent spec framework.

Build Status

Getting Started

You can install Peck as a gem.

$ gem install peck

Write a little test.

require 'peck/flavors/vanilla'

describe MicroMachine do
  it "drives really fast" do

And enjoy the output.

ruby -rubygems spec/micro_machine_spec.rb -e ''
1 spec, 0 failures, finished in 0.0 seconds.

Why another framework/test library/spec language?

I guess that's something you will have to find out for yourself. For us a spec framework needs two things: a good way to describe intention of the specs and flexibility to work with the different types of project we work on.

We really like Bacon and test/spec but we've found that they're to limiting in some of our projects. Bacon doesn't work really well with Rails and test/spec needs test/unit, which will be gone in Ruby 1.9.

In some projects we find that we have an enormous amount of little specs which beg to be run concurrently.

Peck tries to be what we, and maybe you, need it to be. Within reason of course.

Peck can be concurrent

Peck has two run modes: serial and concurrent. Right now that's a global setting for the whole suite.

Peck.concurrency = 9

Some projects don't allow concurrency because either the code or the test suite aren't thread safe. We've also found that some suites actually run slower in threads.

Peck can host your own spec syntax

When implementing your own spec syntax you only have to add expectations to a little accessor when they run and raise Peck::Error when something fails.

describe "Fish" do
  it "breathes with water" do
    # If you don't like .should, you can write your own assertion
    # DSL
    expects {
      Fish.breathes == water

With a bit of work you could make Peck run your Rspec tests.

Peck has a pluggable notification system

You can write your own notifiers and register them with Peck's delegate system.

class Remotifier < Peck::Notifiers::Base
  def finished"https://ci.lan/runs?ran=#{Peck.counter.ran}" +

Peck is extensible

Expect opening up Peck classes you can also extend during runtime with the once callback. This callback is ran when a new context (describe) is created.

Peck::Context.once do |context|
  context.class_eval do
    attr_accessor :controller_class

    before do
      @controller =


Peck is still very much in flux and will probably change a lot in the coming months. Currently we support a small number of assertions:

  • should, should.not, and
  • should.equal
  • should.raise([exception]) { }
  • should.change([expression]) { }
  • should.satisfy { |object| }

If you want to learn more you're probably best of reading the code documentation.


Peck inherits a lot of ideas, concepts and even some implementation from both Bacon and MacBacon. Both of these projects have been released under the terms of an MIT-style license.

Copyright (C) 2007 - 2012 Christian Neukirchen Copyright (C) 2011 - 2012 Eloy Durán Copyright (C) 2012 Manfred Stienstra, Fingertips

Peck is freely distributable under the terms of an MIT-style license. See COPYING or

Something went wrong with that request. Please try again.