Skip to content

Instantly share code, notes, and snippets.

@paulrayner
paulrayner / sample.feature
Last active February 10, 2016 18:33
Sample Feature
Scenario Outline: Score calculation tables
Given a new bowling game
When I roll the following series: <rolls>
Then my total score should be <total score>
Examples:
| game | rolls | total score |
| beginners game | 2,7,3,4,1,1,5,1,1,1,1,1,1,1,1,1,1,1,5,1 | 40 |
| one single spare | 2,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 | 29 |
@paulrayner
paulrayner / thank_you.feature
Last active December 27, 2015 09:29
Thank you!
Feature:
In order to let them know how much I appreciate them and their support
As a business owner
I want to show heartfelt gratitude to my friends and business partners
Scenario: In everything give thanks - 1 Thessalonions 5:18
Given a person who has made a rich contribution to my life and business
When Thanksgiving draws near
Then I want to recognize their awesomeness
And send them a card as a token of my appreciation
@paulrayner
paulrayner / gist:6386391
Last active December 21, 2015 23:59
Asciidoc multi-part book chapter numbering problem
The problem is that I want 'Background and Context' to be chapter 1, but the numbering is messed up. The content
for chapter 1 is coming in from 01_BackgroundAndContext.asc[]. I've tried several things to fix the numbering,
but cannot figure out the correct combination/settings to do it. Maybe I just need to turn off numbering
completely, and name each of the chapters explictly? This is what I had originally, but then I saw that I
was able to get chapter numbers automatically with Asciidoctor & asciidoctor-fopdf.
Here is the relevant part of the AsciiDoc book document:
= BDD with Cucumber
Richard Lawrence and Paul Rayner rslawrence@agileforall.com, paul@virtualgenius.com
@paulrayner
paulrayner / asciidoctor-fopdf-crash-report
Last active December 21, 2015 02:49
asciidoctor-fopdf crashes on my MBP.
>java -version
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)
Here's the stack trace. I can provide the original xml file if that would be helpful.
>./fopdf BDDwithCucumber.xml
Initializing application...
Downloading http://services.gradle.org/distributions/gradle-1.7-bin.zip
@paulrayner
paulrayner / AsciiWatcher.rb
Created March 2, 2013 23:41
AsciiWatcher - live preview one or more AsciiDoc files in Chrome using Asciidoctor to render to HTML and AppleScript to perform the browser tab refresh. Adapted from watch.rb by Brett Terpstra (with credit to Carlo Zottmann).
#!/usr/bin/env ruby
# AsciiWatcher by Paul Rayner, 2013 <http://thepaulrayner.com>
# Adapted from watch.rb by Brett Terpstra, 2011 <http://brettterpstra.com>
# with credit to Carlo Zottmann <https://github.com/carlo/haml-sass-file-watcher>
require 'asciidoctor'
trap("SIGINT") { exit }
if ARGV.length < 2
@paulrayner
paulrayner / My .gitconfig file
Created February 25, 2011 04:58
Excerpt from .gitconfig
[alias]
co = checkout
br = branch
ci = commit
cia = commit -a
st = status
unstage = reset HEAD --
last = log -1 HEAD
d = diff --color
cb = checkout -b