testing...
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 'minitest/autorun' | |
class String | |
def trim | |
file, line_num = caller.first.split(":") | |
line = File.read(file).split("\n")[line_num.to_i - 1] | |
whitespace_num = line[/^[ ]+/].size + 2 | |
self.gsub(/^ {#{whitespace_num}}/, '') | |
end | |
end |
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
# example.com | |
project "example" | |
role 'dev' do | |
package 'git' | |
package 'vim' | |
package 'tmux' | |
end |
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
# DCI in Ruby | |
# 1. entities & values | |
# 2. contexts | |
# 3. tests | |
# 1. entities & values | |
require 'bigdecimal' |
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
# DCI in Ruby | |
# 1. entities & values | |
# 2. contexts | |
# 3. tests | |
# 1. entities & values | |
require 'bigdecimal' |
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 'spec_helper' | |
require 'capybara/rails' | |
Capybara.current_driver = :webkit | |
describe 'Homepage' do | |
it 'works' do | |
begin | |
pid = Process.spawn('ruby lib/proxy.rb') |
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
(set -e; | |
git rev-list --reverse origin/master..master | | |
while read rev; do | |
echo "Checking out: $(git log --oneline -1 $rev)"; | |
git checkout -q $rev; | |
python runtests.py; | |
done) |
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
# POC "Inline" contract tests with MiniTest | |
# | |
# The idea is to run a contract test immediately after a mock object is created. | |
# | |
# Example: | |
# | |
# Say a `Registration` uses `Payment` (which uses `PaymentGateway`) | |
# | |
# def test_successfull_payment | |
# payment = double |
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 'RMagick' | |
require 'capybara' | |
require 'launchy' | |
module Capybara::Recording | |
def start_recording | |
system "rm -f tmp/*" | |
end | |
def save_recording |