Public Gists by jferris

Gravatar
Mon Nov 16 13:11:59 -0800 2009
1
2
3
class Test::Unit::TestCase
  def self.should_should_belong_to(association)
    should "should belong to #{association}" do
Gravatar
Tue Nov 10 12:53:52 -0800 2009
1
2
3
#!/usr/bin/ruby
 
unless failing_feature = ARGV[0]
Gravatar
Thu Sep 17 13:57:36 -0700 2009
1
2
3
module GeoKit
  module Geocoders
    class FakeGeocoder < Geocoder
Gravatar
Wed Aug 05 14:40:16 -0700 2009
1
2
3
# post.class.should have_received(:find).with(post.to_param)
should find(post)
# Post.should have_received(:new).with(post_attrs)
Gravatar
Wed Aug 05 14:38:54 -0700 2009
1
2
3
module PostHelpers
  def stub_post(post_attrs = {})
    post_attrs = {
Gravatar
Wed Aug 05 14:37:40 -0700 2009
1
2
3
describe PostsController do
  it "should show a published post on GET show" do
    post = stub('a post', :to_param => '1')
Gravatar
Wed Aug 05 14:36:10 -0700 2009
1
2
3
describe PostsController, "on GET show" do
  before(:each) do
    @post = stub('a post', :to_param => '1')
Gravatar
Wed Aug 05 14:34:57 -0700 2009
1
2
3
describe PostsController, "on GET show" do
  before(:each) do
    @post = stub('a post', :to_param => '1')
Gravatar
Wed Aug 05 14:33:37 -0700 2009
1
2
3
describe PostsController do
  it "should show the given post on GET show" do
    post = stub('a post', :to_param => '1')
Gravatar
Wed Aug 05 14:30:22 -0700 2009
1
2
3
describe PostsController do
  it "should show the given post on GET show" do
    post = stub('a post', :to_param => '1')
Gravatar
Mon Aug 03 14:06:35 -0700 2009
1
2
3
class UsersControllerTest
  # With context
  context "on GET show, given the user exists" do
Gravatar
Mon Aug 03 12:40:55 -0700 2009
1
2
3
module ModelBuilder
  def self.included(spec)
    spec.before(:each) do
Gravatar
Wed Jul 29 07:10:11 -0700 2009
1
2
3
<?xml version="1.0"?>
<notice version="2.0">
  <api-key>345263346</api-key>
Gravatar
Fri Jul 24 09:56:51 -0700 2009
1
2
3
---
notice:
  api_key: api_key_value
Gravatar
Mon Jun 29 14:29:09 -0700 2009
1
2
3
# completion for schema
_rails_tables() {
  if [[ -n $words[2] ]]; then
Gravatar
Mon Jun 29 14:28:26 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
require 'fileutils'
gist: 134582 should_delegate
Gravatar
Tue Jun 23 08:13:33 -0700 2009
1
2
3
class Test::Unit::TestCase
  # call-seq:
  # should_delegate(method, :to => member)
Gravatar
Wed Mar 04 10:57:08 -0800 2009
1
2
3
#!/usr/bin/env ruby
 
require 'fileutils'
Gravatar
Fri Feb 20 14:48:01 -0800 2009
1
2
3
User.admins # return all admins
User.editors # return all editors
User.admins.editors # return all users that are admins and editors