Skip to content

Instantly share code, notes, and snippets.

View tooky's full-sized avatar

Steve Tooke tooky

View GitHub Profile

Brewery Design Problem

  • The brewery application manages physical inventory, a library of beer recipes, and production of beer.
  • The production system supervises the creation, movement and bottling of beer.
  • Beer is made according to a recipe which specifies ingredients and amounts.
  • Ingredients are mixed in a mixing vat to create a batch of beer. After a batch is mixed, it is moved to a fermenting vat, where readings of its specific gravity will be taken daily.
  • While fermenting, beer temperature will be monitored and kept within a tolerance of the temperature as specified in a recipe.
  • After it has finished fermenting, beer is moved to another vat to settle, then moved again to a bottling vat where it is bottled on an external bottling line.
  • The brewery includes a network of interconnected pipes and vats, an inventory of ingredients, a collection of recipes, and batches of beer both in production and already bottled.
describe 'stuff' do
[1,2,3,4].each do |n|
it n do
expect(n).to be < 5
end
end
end
Feature: Summing numbers
In order to understand the gherkin syntax
As someone new to cucumber
I want a simple example
Scenario: Summing two positive numbers
Given the first number is 1
And the second number is 2
When I sum the numbers
Then the answer is 3
@tooky
tooky / variables.rb
Last active December 24, 2015 03:59
# Fill in the values after # =>
#
$title = "Ruby Variables"
@subtitle = "Where do they come from?"
presenter = "@tooky"
class Presentation
@@length = "10 min"
@style = "Code"
@tooky
tooky / 1-homework.md
Last active December 23, 2015 21:29
On The Beach Academy - Homework

Week 1 Homework

  • Complete the ruby koans
  • Use RSpec to test-drive a solution to either:
  • Write a 10 minute presentation about the topic card you pick
  • BONUS: clone Corey Haines' [practice repo] [1], and use it to help you complete a Game of Life solution.
    • You will need to research [cucumber] [2] and [bundler] [3]
  • Use cucumber and rspec to help guide your code
require 'minitest'
module Cucumber
module MiniTestAssertions
def self.extended(base)
base.extend(MiniTest::Assertions)
base.assertions = 0
end
attr_accessor :assertions
end
@tooky
tooky / gist:5933457
Last active December 19, 2015 09:29
module MiniTestAssertions
def self.extended(base)
base.extend(MiniTest::Assertions)
end
attr_accessor :assertions
end
World(MiniTestAssertions) # this will work
@tooky
tooky / Rakefile
Created June 28, 2013 15:37
A simple way to manage a Jekyll static site that uses plugins
require 'heavies_publish'
require 'launchy'
desc 'Publish the site'
task :publish => 'publish:publish'
namespace :publish do
include Heavies::Publish
directory Heavies::Publish.dir
% VIEW_OTHER_WARNINGS=true rake ~cucumber/cucumber-ruby-core (master)
/opt/rubies/ruby-1.9.3-p392/bin/ruby -w -r./capture_warnings -S rspec ./spec/cucumber/core/ast/background_spec.rb ./spec/cucumber/core/ast/doc_string_spec.rb ./spec/cucumber/core/ast/examples_table_spec.rb ./spec/cucumber/core/ast/outline_step_spec.rb ./spec/cucumber/core/ast/step_spec.rb ./spec/cucumber/core/ast/table_spec.rb ./spec/cucumber/core/compiler_spec.rb ./spec/cucumber/core/gherkin/parser_spec.rb ./spec/cucumber/core/gherkin/writer_spec.rb ./spec/cucumber/core/test/case_spec.rb ./spec/cucumber/core/test/result_spec.rb ./spec/cucumber/core/test/step_spec.rb ./spec/cucumber/core/test/suite_runner_spec.rb ./spec/cucumber/core_spec.rb ./spec/cucumber/initializer_spec.rb --color
......................................................................................................................
------------------------------ other warnings: ------------------------------
/U
class AccountSignup
def self.new(warden, acccount_params)
account = Subscribem::Account.create(account_params)
account.create_schema
UserSignup.new(warden, account, account.owner)
end
end