Skip to content

Instantly share code, notes, and snippets.

/Users/light/.rvm/gems/ruby-1.8.7-p302@cotweet-yellowdart/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require': no such file to load -- rails (MissingSourceFile)
from /Users/light/.rvm/gems/ruby-1.8.7-p302@cotweet-yellowdart/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/light/.rvm/gems/ruby-1.8.7-p302@cotweet-yellowdart/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/light/.rvm/gems/ruby-1.8.7-p302@cotweet-yellowdart/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in `require'
from /Users/light/.rvm/gems/ruby-1.8.7-p302@cotweet-yellowdart/gems/evergreen-0.3.0/lib/evergreen/rails.rb:2
from /Users/light/work/tdd/cotweet/.bundle/environment.rb:308:in `require'
from /Users/light/work/tdd/cotweet/.bundle/environment.rb:308:in `require'
from /Users/light/work/tdd/cotweet/.bundle/environment.rb:306:in `each'
from /Users/light/work/tdd/cotweet/.bundle/environment.rb:306:in `requ
Error: TypeError: Cannot call method '<insert some method name -- yes, I put this here not Jasmine>' of undefined
at new <anonymous> (http://localhost:9887/jasmine/jasmine.js:89:50)
at [object Object].fail (http://localhost:9887/jasmine/jasmine.js:1900:27)
at [object Object].execute (http://localhost:9887/jasmine/jasmine.js:962:15)
at [object Object].next_ (http://localhost:9887/jasmine/jasmine.js:1708:31)
at [object Object].start (http://localhost:9887/jasmine/jasmine.js:1665:8)
at [object Object].execute (http://localhost:9887/jasmine/jasmine.js:1955:14)
at [object Object].next_ (http://localhost:9887/jasmine/jasmine.js:1708:31)
at [object Object].start (http://localhost:9887/jasmine/jasmine.js:1665:8)
at [object Object].execute (http://localhost:9887/jasmine/jasmine.js:2100:14)
def fork_tourist
fork do
# we're in the child
# run your tour
end
end
number_of_tours = 20
should "what happens to those intersecting gliders!?" do
board = Board.new([
[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],
[0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Test Runner</title>
<link rel="stylesheet" type="text/css" href="jasmine/lib/jasmine.css">
<script type="text/javascript" src="jasmine/lib/jasmine.js"></script>
<script type="text/javascript" src="jasmine/lib/jasmine-html.js"></script>
</head>
<body>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Test Runner</title>
<link rel="stylesheet" type="text/css" href="jasmine/lib/jasmine.css">
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript" src="coffee-script.js"></script>
<script type="text/javascript" src="jasmine/lib/jasmine.js"></script>
<script type="text/javascript" src="jasmine/lib/jasmine-html.js"></script>
require 'nokogiri
require 'open-uri'
io = open 'http://slashdot.org'
text = io.read
doc = Nokogiri::HTML::Document.parse(text)
# Just in case you didn't know, "#<some id here>" is a CSS selector for locating an HTML element by ID
doc.css("#top_parent a").count
# voila!
@elight
elight / user.rb
Created December 3, 2010 19:15
Handling case sensitivity with Devise
class User < ActiveRecord::Base
before_save do
self.email.downcase! if self.email
end
def self.send_reset_password_instructions(attributes={})
attributes[:email].downcase!
super(attributes)
end
end
@elight
elight / find_a_bad_backtrace.rb
Created December 15, 2010 19:17
Coulda sometimes generates a backtrace that ends in a shared step instead of tracing back to the calling test. Sadly, this gist has been unable to replicate that behavior.
require 'rubygems'
require 'coulda'
require 'raise_from_module'
Feature "Experimenting with Coulda" do
extend RaiseFromModule
def self.given_i_raise
Given "I raise an Exception" do
raise Exception, "testing from Coulda"
@elight
elight / test_helper.rb
Created December 23, 2010 17:59
Excerpt from my test_helper
class SeleniumTest < ActionController::IntegrationTest
self.use_transactional_fixtures = false
def setup
DatabaseCleaner.clean
Capybara.current_driver = :selenium
super
end
def teardown