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 Module | |
def method_added(name) | |
p "#{name},#{caller[0..1]}" | |
end | |
end | |
class TestClass | |
def foo | |
p 'pure foo' |
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
var someAnonMethod = (s:String) => println(s) | |
// Unit is Scala void | |
def execute(paramMethod: (String) => Unit) { | |
println("do hard stuff") | |
paramMethod("our function") | |
println("close hard stuff") | |
} | |
def nonAnonMethod(s:String) { |
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 Symbol | |
def |(*args) | |
@args = args | |
self | |
end | |
def to_proc | |
Proc.new { |obj| | |
obj.send *[self] + (@args || []) | |
} |
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
gem 'guard' | |
gem 'guard-rspec' | |
gem 'libnotify' | |
gem 'rb-fsevent' |
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
map <F2> :<C-U>!bundle exec rspec <C-R>=expand("%:p") <CR> --drb -l <C-R>=line("'.") <CR> <CR> | |
map <C-F11> :call RunCurrentTest()<CR> | |
nmap <F11> :call RunLastTest()<CR> | |
nmap <F12> :!rspec <C-R>% --drb<CR> | |
function RunLastTest () | |
if exists('w:current_test') | |
exe '!rspec ' . w:current_test . ' --drb' | |
else |
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
device = Factory :device | |
device.should_receive(:notify) | |
# event will got object with expactations: | |
Factory :event, :device => device |
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 'test/unit' | |
class KeyTest < Test::Unit::TestCase | |
def test_key | |
object = Object.new | |
assert_equal(:submit, object_key(object)) | |
def object.persisted?; true end | |
assert_equal(:update, object_key(object)) |
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
#include <cstdio> | |
using namespace std; | |
class Container; | |
class Element; | |
class Container { | |
private: | |
Element *container[100]; | |
int i; |