Skip to content

Instantly share code, notes, and snippets.

@therealadam
Created April 21, 2009 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save therealadam/99200 to your computer and use it in GitHub Desktop.
Save therealadam/99200 to your computer and use it in GitHub Desktop.
require 'test/unit'
require 'rubygems'
require 'activesupport'
require 'shoulda/test_unit'
module ShouldaExtensions
def self.included(klass)
klass.class_eval do
include FixmeMethods
alias_method_chain :build, :fixmes
end
end
module FixmeMethods
def should_fixme(name, &block)
(@should_fixmes ||= []) << name
end
def build_with_fixmes
build_without_fixmes
@should_fixmes.each do |name|
test_name = [full_name, 'should', "#{name}. "].flatten.join(' ')
puts " * FIXME: " + test_name
end
end
end
end
Shoulda::Context.method(:include).call(ShouldaExtensions)
class FooTest < Test::Unit::TestCase
context 'Foo' do
should_fixme 'write this stuff'
should 'honk' do
assert true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment