Skip to content

Instantly share code, notes, and snippets.

View fables-tales's full-sized avatar
💭
I may be slow to respond.

Fable Tales fables-tales

💭
I may be slow to respond.
View GitHub Profile
@fables-tales
fables-tales / spies.md
Last active August 29, 2015 14:24 — forked from nelstrom/spies.md

Write a simple library to enable testing with spies.

Here's a simple Ruby app which interacts with a RESTful API. The app has a passing test suite, but the tests are an incomplete specification of its behaviour. Add a set of isolated tests that spy on collaborations between objects to complete the test suite.

def foo(block)
p [:foo, 1]
block.call
p [:foo, 2]
end
def bar(block)
p [:bar, 1]
foo(block)
p [:bar, 2]
@fables-tales
fables-tales / examples.rb
Last active December 15, 2015 01:39 — forked from andrew/examples.rb
number = 1
string = "andrew"
hash = { "foo" => "bar" }
array = [1,3,2]
symbol = :cheese