Skip to content

Instantly share code, notes, and snippets.

View rich's full-sized avatar

Rich Cavanaugh rich

  • Port Saint Lucie, FL
  • 09:13 (UTC -04:00)
View GitHub Profile
require 'test_helper'
class AlbumTest < ActiveSupport::TestCase
should_belong_to :profile
should_have_many :entries
should_be_taggable
should_be_commentable
should_be_slugged
end
module ActsAsCommentable
module Shoulda
def should_be_commentable
should_have_many :comments
should_have_class_methods :find_comments_for, :find_comments_by_user
should_have_instance_methods :add_comment, :comments_ordered_by_submitted
end
end
end
From 5a37943331e6a12b81ba55d9014c7481427e9d85 Mon Sep 17 00:00:00 2001
From: Rich Cavanaugh <rich@silverback.local>
Date: Wed, 6 Aug 2008 12:11:20 -0400
Subject: [PATCH] Add the ability to alias a task name so tasks can be named the same as a built in ruby method.
Add specs for this functionality.
---
lib/thor.rb | 10 +++++++---
spec/thor_spec.rb | 17 +++++++++++++++++
2 files changed, 24 insertions(+), 3 deletions(-)
Last login: Sat Jul 26 20:54:27 on ttys007
~ $ mkdir git-bug
~ $ cd git-bug/
~/git-bug $ git init
Initialized empty Git repository in /Users/rich/git-bug/.git/
~/git-bug $ echo "test line one" > readme
~/git-bug $ git add readme
~/git-bug $ git commit -a -m "one"
Created initial commit 541fc1d: one
1 files changed, 1 insertions(+), 0 deletions(-)