Skip to content

Instantly share code, notes, and snippets.

View tooky's full-sized avatar

Steve Tooke tooky

View GitHub Profile
Feature: Tag logic
In order to conveniently run subsets of features
As a Cuker
I want to select features using logical AND/OR of tags
Background:
Given a file named "features/test.feature" with:
"""
@feature
Feature: Sample
@tooky
tooky / 1-presentations.md
Last active August 29, 2015 14:16
otb-homework-mar-2015
  1. Ruby - what is bundler? - Tom Clark
  2. git - tags vs branches - Tom Bates
  3. git - rebase vs merge - Tom Altree
  4. Ruby modules and include, extend, prepend - Duncan Smith
  5. Ruby's Enumerable and Enumerators - John Foulkes
  6. Ruby's blocks, procs and lambdas - Chris Rigby
  7. Inheritance vs Composition, with examples in Ruby - James Walsh
@tooky
tooky / 1-first-week.md
Last active August 29, 2015 14:07
On The Beach Academy, October 2014 – Homework

Week 1 - Homework

  • Complete the remaining exercises (note: you can run each file individually using rspec <filename>)
  • Work through them in the following order:
    • spec/iteration_spec.rb
    • spec/blocks_spec.rb
    • spec/sandwich_code_spec.rb
    • spec/scoring_project_spec.rb
    • spec/classes_spec.rb
  • spec/open_classes_spec.rb

Keybase proof

I hereby claim:

  • I am tooky on github.
  • I am tooky (https://keybase.io/tooky) on keybase.
  • I have a public key whose fingerprint is 0673 CCBC 3115 597C CCCA 2037 AF26 35BF 75D2 81D9

To claim this, I am signing this object:

require 'sinatra'
get '/foo.jpg' do
# foo.jpg in the app root directory
send_file 'foo.jpg', disposition: 'inline'
end
run Sinatra::Application
Feature: Sign up
Scenario: New user redirected to their own page
Given I am not logged in
And I visit the homepage
And I follow "Sign up"
And I fill in "Username" with "Matt"
And I fill in "Password" with "password"
And I fill in "Confirm password" with "password"
When I press "Sign up"
Then I should be on my feeds page
Scenario: Create an invoice
Given I am an authenticated user with an admin role
And a client "test client" exists with name: "test client", initials: "TTC"
And a project "test project" exists with name: "test project", client: client "test client"
And a ticket "test ticket" exists with project: project "test project", name: "test ticket"
And a work_unit "test work unit" exists with ticket: ticket "test ticket", scheduled_at: "2010-01-01", hours: "1"
And I am on the admin invoices page
Then I should see "test client"
And I follow "test client"
And I fill in "global_invoiced" with "123"
# Corey's challenge is to make the second test pass without ever making the first test fail.
# run ruby stack.rb to run the tests
# For more information see http://tooky.co.uk/kickstart-academy-podcast-with-corey-haines-and-sandi-metz/
class Stack
def empty?
true
end
def push(element)
@empty = false
class Bottles
def song
verses(99, 0)
end
def verses(upper_bound, lower_bound)
upper_bound.downto(lower_bound).map { |i| verse(i) }.join("\n")
end
@tooky
tooky / stack.rb
Created June 26, 2014 09:23
Challenge made by @coreyhaines on the http://kickstartacademy.io podcast.
class Stack
def empty?
true
end
def push(element)
@empty = false
end
end
def assert(expected, actual, msg="FAIL!")