This file contains hidden or 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
module GitCommands | |
class ShellError < RuntimeError; end | |
@logging = ENV['LOGGING'] != "false" | |
def self.run cmd, *expected_exitstatuses | |
puts "+ #{cmd}" if @logging | |
output = `#{cmd} 2>&1` | |
puts output.gsub(/^/, "- ") if @logging | |
expected_exitstatuses << 0 if expected_exitstatuses.empty? |
This file contains hidden or 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 ApplicationHelperTest < ActionView::TestCase | |
include ActionController::UrlWriter | |
default_url_options[:host] = 'localhost' | |
end |
This file contains hidden or 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 << Test::Unit::TestCase | |
def context name, &block | |
(@contexts ||= []) << name | |
(@context_blocks ||= []) << block | |
saved_setups = (@context_setups ||= []).dup | |
saved_teardowns = (@context_teardowns ||= []).dup | |
self.instance_eval(&block) | |
@context_setups = saved_setups |
This file contains hidden or 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 'open-uri' | |
begin | |
content = open('http://www.isitchristmas.com/').read | |
rescue *HTTP_ERRORS => exception | |
HoptoadNotifier.deliver_exception(exception) | |
content = 'Christmas is canceled' | |
end |
This file contains hidden or 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
qrush@crookedkey /h/r/g/r/20090513220338> cat /etc/apache2/sites-available/gemcutter.org | |
<VirtualHost *:80> | |
ServerName gemcutter.org | |
ServerAlias www.gemcutter.org | |
DocumentRoot /home/rails/gemcutter/current/lib/gemcutter/public | |
LogLevel warn | |
ErrorLog /home/rails/gemcutter/shared/log/error.log | |
CustomLog /home/rails/gemcutter/shared/log/access.log combined | |
</VirtualHost> |
This file contains hidden or 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
$ time rake test:units test:functionals | |
Started | |
.......... (abbreviated... FOR BLOG READING SPEED!!) | |
415 tests, 898 assertions, 0 failures, 0 errors | |
29.14s user 3.74s system 87% cpu 37.614 total |
This file contains hidden or 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
$ time rake test:units test:functionals | |
Started | |
.......... (abbreviated... FOR BLOG READING SPEED!!) | |
415 tests, 898 assertions, 0 failures, 0 errors | |
29.14s user 3.74s system 87% cpu 37.614 total |
This file contains hidden or 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
$ time rake test:units test:functionals | |
Started | |
.......... (abbreviated... FOR BLOG READING SPEED!!) | |
415 tests, 898 assertions, 0 failures, 0 errors | |
29.14s user 3.74s system 87% cpu 37.614 total |
This file contains hidden or 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
$ script/plugin install git://github.com/jasonm/parallel_specs.git |
This file contains hidden or 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
$ rake db:structure:dump | |
$ echo "create database myapp_test2;" | mysql -uroot | |
$ mysql -uroot -Dmyapp_test2 < db/development_structure.sql | |
$ vim config/database.yml # add some ERB to config/database.yml | |
test: | |
adapter: mysql | |
encoding: utf8 | |
database: myapp_test<%= ENV['TEST_ENV_NUMBER'] %> | |
username: root |
OlderNewer