Topics: Blue pill x Red pill talk
- Agile Manifesto
- Scrum
- Extreme Programming
- Behavior Driven Development
- Test Driven Development: By Example
| # Este é um exemplo encontrado na última edição do Programming Ruby do Dave Thomas, página 53. | |
| # testa o método que converte uma string em um array de palavras | |
| def test_empty_string | |
| assert_equal([], words_from_string("")) | |
| assert_equal([], words_from_string(" ")) | |
| end | |
| def test_single_word | |
| assert_equal(["cat"], words_from_string("cat")) |
| set fuoptions=maxvert | |
| function ToggleFullScreen() | |
| if exists("s:old_columns") | |
| set columns=s:old_columns | |
| set nofu | |
| unlet s:old_columns | |
| else | |
| let s:old_columns=&columns | |
| set columns=84 fu |
| ** Execute vm/test/runner | |
| Running 1 tasks using 3 parallel threads | |
| 1: GN vm/test/runner.cpp | |
| 1: CC vm/test/runner.cpp | |
| In file included from vm/test/runner.cpp:3322: | |
| ./vm/test/test_pointer.hpp: In member function ‘void TestPointer::test_read_long()’: | |
| ./vm/test/test_pointer.hpp:89: error: no matching function for call to ‘rubinius::Pointer::read_long(rubinius::VM*&)’ | |
| vm/builtin/ffi_pointer.hpp:62: note: candidates are: rubinius::Integer* rubinius::Pointer::read_long(rubinius::VM*, rubinius::Object*) | |
| ./vm/test/test_pointer.hpp: In member function ‘void TestPointer::test_write_long()’: | |
| ./vm/test/test_pointer.hpp:97: error: no matching function for call to ‘rubinius::Pointer::read_long(rubinius::VM*&)’ |
| # Configure post-commit hook to take a photo | |
| function gimage() { | |
| cp ~/.post-commit-image .git/hooks/post-commit | |
| } |
| on alfred_script(q) | |
| tell application "System Events" | |
| set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0 | |
| end tell | |
| if isRunning then | |
| tell application id "com.Growl.GrowlHelperApp" | |
| set paused to is paused | |
| if (paused) then | |
| resume |
| source 'https://rubygems.org' | |
| gem 'aws-sdk', '~> 1.30.1' |
I hereby claim:
To claim this, I am signing this object:
| lengthOf x | |
| | length x == 0 = "0" | |
| | otherwise = length x | |
| {-- | |
| lengthOf.hs:3:17: | |
| Couldn't match expected type `[Char]' with actual type `Int' | |
| In the return type of a call of `length' | |
| In the expression: length x | |
| In an equation for `lengthOf': |
| def flatten(arr) | |
| out = [] | |
| arr.each do |a| | |
| if a.is_a?(Array) | |
| out += flatten(a) | |
| else | |
| out << a | |
| end | |
| end |