Created
April 21, 2009 15:43
-
-
Save therealadam/99200 to your computer and use it in GitHub Desktop.
This file contains 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
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