Skip to content

Instantly share code, notes, and snippets.

# example.feature
Feature: Example
Scenario: Eat
Given I am hungry
Then I should eat
# example_steps.rb
require 'spec'
# i have an option box that stores text ("day", "week" or "month" -
# representing the accuracy of a date) to a database that is then used
# when displaying the date (i.e. decides what accuracy to show it to).
class Event
attr_accessor :date, :accuracy
def to_s
Scenario Outline: whatever
Given '<user>' has full rights
Examples:
| user |
| Aidy |
Feature: Anaphora example
Scenario: Punish bad pets
Given I am a pet owner
And I have a dog called Derek
And I have a cat called Connie
Then I should give them dinner
And I should not give them treats
When Derek barks at Connie
Then I should give Connie treats
@joshski
joshski / Find duplicate element ids with jquery
Created March 2, 2010 18:07
Find duplicate element ids with jquery
var idCounts = {};
$("*").each(function() {
if (this.id != '')
idCounts[this.id] = (idCounts[this.id] || 0) + 1;
});
for (var i in idCounts) {
if (idCounts[i] > 1)
console.log(i + "=" + idCounts[i]);
}
> cucumber --version
0.6.3
Scenario Outline: Incorrect Search Output
When I do an invalid search of: "<keywords>"
Then an invalid search result page of "<response>" should not be returned!
Examples:
| keywords | response |
import System.IO
import Network
import Minecraft
import Control.Monad
import Control.Monad.Fix
import Control.Monad.Trans
import Control.Monad.BinaryProtocol
import Control.Concurrent
import Control.Concurrent.STM
import Control.Concurrent.STM.TChan
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/div/html4/strict.dtd">
<html>
<head>
<title>Tiny Samsung Video App</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type='text/javascript' language='javascript' src='$MANAGER_WIDGET/Common/API/Widget.js'></script>
</head>
<body onload="bodyLoad()" onunload="bodyUnload()">
<object id="videoPlugin" border=0 classid="clsid:SAMSUNG-INFOLINK-PLAYER"></object>
<object id="audioPlugin" border=0 classid="clsid:SAMSUNG-INFOLINK-AUDIO"></object>
@joshski
joshski / example.cakefile
Created April 16, 2011 08:54
My first cakefile
CoffeeScript = require 'coffee-script'
{exec} = require 'child_process'
fs = require 'fs'
SOURCES = [
'app',
'line'
]
task 'features', 'Run the cucumber features (with mininal output)', ->
/* SiteCatalyst code version: H.23.3.
Copyright 1996-2011 Adobe, Inc. All Rights Reserved
More info available at http://www.omniture.com */
var s_account="bbciptvnewsdev"
var s=s_gi(s_account)
/************************** CONFIG SECTION **************************/
/* You may add or alter any code config here. */
s.charSet="ISO-8859-1"
/* Conversion Config */