Sha256: 2ad12bccb488656ea41e7ea267c2e92308ab0ec08f7149a954d766ddb455d971

Contents?: true

Size: 845 Bytes

Versions: 4

Compression:

Stored size: 845 Bytes

Contents

require 'rubygems'

# Testing dependencies
require 'test/unit'
require 'shoulda'
# RedGreen doesn't seem to be needed under 1.9
require 'redgreen' if RUBY_VERSION < "1.9"

require 'pathname'
root_directory = Pathname(__FILE__).dirname.join("..").expand_path
require root_directory.join("lib", "bird_grinder")

class Test::Unit::TestCase

  protected
  
  # Short hand for creating a class with
  # a given class_eval block.
  def class_via(*args, &blk)
    klass = Class.new(*args)
    klass.class_eval(&blk) unless blk.blank?
    return klass
  end
  
  # Short hand for creating a test class
  # for a set of mixins - give it the modules
  # and it will include them all.
  def test_class_for(*mods, &blk)
    klass = Class.new
    klass.class_eval { include(*mods) }
    klass.class_eval(&blk) unless blk.blank?
    return klass
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
birdgrinder-0.1.5 test/test_helper.rb
birdgrinder-0.1.4.0 test/test_helper.rb
birdgrinder-0.1.3.1 test/test_helper.rb
birdgrinder-0.1.3.0 test/test_helper.rb