Skip to content

Instantly share code, notes, and snippets.

diff --git a/lib/ey_recipes/cli.rb b/lib/ey_recipes/cli.rb
index 3945c64..1816aea 100644
--- a/lib/ey_recipes/cli.rb
+++ b/lib/ey_recipes/cli.rb
@@ -165,7 +165,7 @@ module EY::Recipes
end
file = "recipes.#{$$}.#{Time.now.to_i}.tmp.tgz"
- tarcmd = "git archive --format=tar HEAD | gzip > #{file}"
+ tarcmd = "git archive --format=tar $(git ls-tree HEAD cookbooks | awk '{print $3}') --prefix=cookbooks/ | gzip > #{file}"
require 'rubygems'
require 'hpricot'
require 'open-uri'
doc = Hpricot(open('http://stocknames.info'))
names = doc / '.list ul li'
puts names[rand(names.size)].innerText
Enforcer "thoughtbot", "deadbeef" do
project "shoulda", "sseagal", "jcvandamme", "cnorris"
end
$ time rake test:parallel
(in /Users/jasonmorrison/dev/myapp/trunk)
2 processes for 49 tests, ~ 24 tests per process
Loaded suite -e
Started
.................................. (abbreviated)
29.32s user 3.31s system 143% cpu 22.669 total
$ 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
$ script/plugin install git://github.com/jasonm/parallel_specs.git
$ 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
class HouseSearch
attr_accessor :keyword, :price
def initialize(params)
params ||= {}
params.each do |key, value|
self.send("#{key}=", value)
end
end
class HouseSearchesController < ApplicationController
def index
@house_search = HouseSearch.new(params[:house_search])
@houses = @house_search.results
end
end
class HouseSearchTest < ActiveSupport::TestCase
should "produce an error on the :price field when sent #new with an invalid price range" do
house_search = HouseSearch.new(:price => 'unknown')
assert_kind_of ActiveRecord::Errors, house_search.errors
assert_not_nil house_search.errors.on(:price)
end
end