Created
February 22, 2010 22:41
-
-
Save garybernhardt/311602 to your computer and use it in GitHub Desktop.
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
# One extra keyword needed for an RSpec clone. Just sayin. | |
describe('integers') do: | |
it('can be added') do: | |
expect(1 + 1) == 2 | |
it('can be subtracted') do: | |
expect(2 - 1) == 1 | |
it('truncates on division') do: | |
expect(3 / 2) == 1 | |
# Implement blocks with plain old generators: | |
def describe(description): | |
... set stuff up | |
yield | |
... tear stuff down | |
# Required semantic change: when a generator is called with a block included, | |
# "yield" always calls directly into that block instead of suspending the | |
# generator. | |
# Good idea? Maybe... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment