Skip to content

Instantly share code, notes, and snippets.

View passalini's full-sized avatar

Pedro Henrique Passalini passalini

  • Campos dos Goytacazes
View GitHub Profile
@passalini
passalini / gist:9388731
Last active August 29, 2015 13:57 — forked from waldofe/gist:9282553
zrun, to run specs and save the ones tha fail
function zrun() {
SPEC_FILE=$1
SPEC_LOG=/tmp/rspec.log
if [ $SPEC_FILE ]; then
rspec $SPEC_FILE 2>&1 | tee $SPEC_LOG
else
cat $SPEC_LOG | grep "^rspec" | cut -d ' ' -f 2 | xargs rspec 2>&1 | tee $SPEC_LOG
fi
}
@passalini
passalini / foo.rb
Created November 26, 2013 17:38
Multiple assertions with rspec change
class Foo
attr_reader :bar, :buzz
def initialize
@bar = 1
@buzz = 1
end
def add
@bar += 1
@passalini
passalini / gist:6614466
Last active December 23, 2015 09:29
test chosen (ajax) with capybara
within('.chzn-search') do
find('input').set element_name
end
sleep(1)
within(".chzn-results") do
find('li.active-result').click
end