Skip to content

Instantly share code, notes, and snippets.

View ben-biddington's full-sized avatar

Ben Biddington ben-biddington

View GitHub Profile

String Calculator

Before you start:

Try not to read ahead. Do one task at a time. The trick is to learn to work incrementally. Make sure you only test for correct inputs. there is no need to test for invalid inputs for this kata

String Calculator

@ben-biddington
ben-biddington / .gitignore
Last active December 15, 2015 15:29
A companion for On Decomposition (maybe)
.rvmrc
@ben-biddington
ben-biddington / Gemfile
Last active December 15, 2015 13:29
SRP Examples
source "https://rugygems.org"
gem 'rspec'
class Rectangle
attr_accessor :left
def initialize(surface)
@surface = surface
end
def constrain
@left = @surface.left if @left > @surface.left
end
*.swp
snaps/
@ben-biddington
ben-biddington / Gemfile
Created November 2, 2012 20:22
The Roman Numerals Kata
source :rubygems
gem "rspec"
@ben-biddington
ben-biddington / fizz_buzz.rb
Created September 21, 2012 08:03
OO Fizz Buzz
# See: http://www.codecademy.com/forum_questions/4f97524f1a89c30003000a62
require "./rules"
class Answer
def initialize(items = [])
@items = items
end
def for(number)
index = number > 0 ? number - 1 : 0
@ben-biddington
ben-biddington / .gitignore
Created August 25, 2012 08:26
Roles, messages and arguments
Gemfile Gemfile.lock
@ben-biddington
ben-biddington / Gemfile
Created August 20, 2012 00:35
TDD and refactoring to composites
source :rubygems
gem "rspec"
require "rspec"
Object.class_eval do
alias :must :should
alias :must_not :should_not
def should; fail "Should is lame, use must"; end
def should_not; fail "Should is lame, use must"; end
end