Blocks, Procs and lambdas (referred to as closures in Computer Science) are one of the most powerful aspects of Ruby, and also one of the most misunderstood. This is probably because Ruby handles closures in a rather unique way. Making things more complicated is that Ruby has four different ways of using closures, each of which is a tad bit different, and sometimes nonsensical. There are quite a few sites with some very good

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
everything i write on medium is a lie | |
xoxo j$ |
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
# This custom matcher can be used to test state machine | |
# | |
# Examples | |
# | |
# it { should have_event(:status, :event_name, [:state1, :state2] => [:state3, :state4]) } | |
# it { should have_event(:status, :event_name, { | |
# :state1 => :state3, | |
# :state1 => :state4, | |
# :state3 => :state3, | |
# :state2 => :state4 |
Integration of seeing_is_believing
to sublime text 2/3 as a plugin with RVM on OS X.
$ rvm 2.0.0@sublime-text-2 --create
or for ST-3$ rvm 2.0.0@sublime-text-3 --create
$ gem install seeing_is_believing
$ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
or for ST-3$ cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
git clone git://github.com/JoshCheek/sublime-text-2-seeing-is-believing.git SeeingIsBelieving
$ rvm wrapper 2.0.0@sublime-text-2 sublime
or for ST-3 $ rvm wrapper 2.0.0@sublime-text-3 sublime
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
## https://github.com/jnicklas/capybara | |
#=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
#=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') |