Skip to content

Instantly share code, notes, and snippets.

@mattly
Created June 14, 2009 19:07
Show Gist options
  • Select an option

  • Save mattly/129781 to your computer and use it in GitHub Desktop.

Select an option

Save mattly/129781 to your computer and use it in GitHub Desktop.
class MiniTest::Spec
# beacuse test names are really just comments, and therefore a code smell
def self.expect(desc=nil, &block)
@counter ||= 0; @counter += 1
desc ||= "[#{@counter}]"
name = ["test_", description_stack.join(' '), desc].join(' ')
define_method name, &block
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment