Skip to content

Instantly share code, notes, and snippets.

View msassak's full-sized avatar

Mike Sassak msassak

View GitHub Profile
@msassak
msassak / en.rb
Created September 22, 2011 17:05
# line 1 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en.rb.rl"
require 'gherkin/lexer/i18n_lexer'
module Gherkin
module RbLexer
class En #:nodoc:
# line 116 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en.rb.rl"
@msassak
msassak / cucumber.feature
Created June 13, 2011 20:16
cucumber.feature
Feature: testing cucumber
Background:
Given a scenario "Thingamabob" with:
"""
Given a thingamabob
When I frobnicate the thingamabob
Then it makes happy kittens
"""
Scenario:
describe "something" do
it "fails" do
raise "failure"
end
end
Feature: test
Scenario: local bin # features/t.feature:2
Given I successfully run `todo oh hai` # aruba-0.3.5/lib/aruba/cucumber.rb:108
Then the output should contain exactly: # aruba-0.3.5/lib/aruba/cucumber.rb:153
"""
oh
hai
"""
@msassak
msassak / steps.rb
Created March 2, 2011 20:09 — forked from DCarper/steps.rb
When /^I delete that comment$/ do
Comment.count.should == 1
@comment = Comment.last
debugger
When %Q{I press "X" within "#comments li:first .destroy_comment"}
end
@msassak
msassak / n2c.erl
Created February 17, 2011 22:56
The simplest thing that can possibly work.
-module(n2c).
-export([n2c/1]).
n2c("255.255.255.255") -> 32;
n2c("255.255.255.254") -> 31;
n2c("255.255.255.252") -> 30;
n2c("255.255.255.248") -> 29;
n2c("255.255.255.240") -> 28;
n2c("255.255.255.224") -> 27;
n2c("255.255.255.192") -> 26;
module NavWorld
class << self
def nav_callbacks
@nav_callbacks ||= {}
end
def under(path, &block)
nav_callbacks[path] = block
end
| type | doors |
| SD Plus™ Door | 2 |
$ ruby-1.8.7-p302 method_chain.rb
method_chain.rb:2: syntax error, unexpected '.', expecting $end
.gsub(/f/, "")
^
$ ruby-1.9.2-p0 method_chain.rb
OO
#!/usr/bin/env ruby
require 'csv'
class Converter
def initialize(feature)
@feature = feature
end
def to_gherkin