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
/** | |
* | |
* benchmark.js | |
* | |
*/ | |
define ( | |
[ ], | |
function() { | |
function benchMark(name, func) { |
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
group :test do | |
gem 'shoulda' | |
gem 'factory_girl_rails' | |
gem 'rspec-rails' | |
gem 'turnip' | |
gem 'capybara' | |
gem 'selenium' | |
gem 'capybara-webkit' | |
gem 'capybara-firebug' | |
gem 'mocha' |
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
YourApp::Application.configure do | |
# Settings specified here will take precedence over those in config/application.rb | |
# ... | |
# Disable Rails's static asset server (Apache or nginx will already do this) | |
config.serve_static_assets = false | |
# Compress JavaScripts and CSS | |
config.assets.compress = true |
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
~/code/projects/aardmark > be rspec -t @wip | |
Run options: include {:wip=>true} | |
./Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:21:in `puts' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/connection.rb:21:in `puts' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/browser.rb:84:in `block in command' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/browser.rb:83:in `each' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/browser.rb:83:in `command' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit/browser.rb:18:in `find' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/capybara-webkit-0.12.1/lib/capybara/driver/webkit.rb:43:in `find' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/capybara-1.1.2/lib/capybara/node/finders.rb:15 |
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
~/code/projects/aardmark > be rspec -t @wip | |
Run options: include {:wip=>true} | |
./Users/dcarper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/protocol.rb:143:in `rescue in rbuf_fill' | |
/Users/dcarper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill' | |
/Users/dcarper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil' | |
/Users/dcarper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/protocol.rb:132:in `readline' | |
/Users/dcarper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line' | |
/Users/dcarper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/http.rb:2551:in `read_new' | |
/Users/dcarper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/http.rb:1319:in `block in transport_request' | |
/Users/dcarper/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/net/http.rb:1316:in `catch' |
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
pry(main)> Thread.new { 10.times { puts Thread.list[0].backtrace.join "\n"; sleep 0.1 } } | |
=> #<Thread:0x007fff0b0ee270 sleep> | |
[2] pry(main)> /Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/pry_instance.rb:253:in `rep' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/pry_instance.rb:231:in `block (3 levels) in repl' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/pry_instance.rb:230:in `loop' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/pry_instance.rb:230:in `block (2 levels) in repl' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/pry_instance.rb:229:in `catch' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/pry_instance.rb:229:in `block in repl' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/pry_instance.rb:228:in `catch' | |
/Users/dcarper/.rvm/gems/ruby-1.9.3-p286/gems/pry-0.9.10/lib/pry/pry_instance.rb:228:in `repl' |
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
[1] pry(main)> Thread.new { sleep 0.5; Process.kill :SEGV, $$ } | |
=> #<Thread:0x007f7f7c1683e0 sleep> | |
[2] pry(main)> (pry):1: [BUG] Segmentation fault | |
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin11.4.0] | |
-- Control frame information ----------------------------------------------- | |
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC :kill | |
c:0003 p:0031 s:0006 b:0006 l:001d98 d:000005 BLOCK (pry):1 | |
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH | |
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP |
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
(def square (fn [n] (* n n))) | |
(def sum-squares | |
(fn [& args]( | |
(+ (map square args )) | |
)) | |
) | |
(prn "squares: " (map square [1 2 3 4])) | |
(prn "hardcoded sum of squares:" (apply + (map square [1 2 3 4]))) |
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
def scope(selector, &block) | |
yield @page.find(selector) | |
end | |
describe Blah do | |
it 'should do stuff' do | |
scope("#selector") do |chunk| | |
chunk.should_not have_content('snosberry') | |
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
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
# rspec/rails | |
require 'rspec/core' | |
RSpec::configure do |c| | |
c.backtrace_clean_patterns << /vendor\// | |
c.backtrace_clean_patterns << /lib\/rspec\/rails/ |
NewerOlder