- 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
class Foo | |
attr_accessor :a | |
def initialize | |
@a = :unchanged | |
end | |
# call 'a' with explicit 'self' as receiver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stack | |
def empty? | |
true | |
end | |
def push(element) | |
@empty = false | |
end | |
end | |
def assert(expected, actual, msg="FAIL!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/foo.jpg' do | |
# foo.jpg in the app root directory | |
send_file 'foo.jpg', disposition: 'inline' | |
end | |
run Sinatra::Application |
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:
- 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
OlderNewer