Sha256: 9b461f839b2c462de0d786b48b103e02d9b79e10b5f53b303d6d3f26b08d1df8

Contents?: true

Size: 765 Bytes

Versions: 6

Compression:

Stored size: 765 Bytes

Contents

require 'test/unit'
require 'mocha'
require 'dust'
require 'set'
require 'expectations'

require File.expand_path(File.dirname(__FILE__) + '/../lib/validatable')

class << Test::Unit::TestCase
  def expect(expected_value, &block)
    define_method :"test_#{caller.first.split("/").last}" do
      begin
        assert_equal expected_value, instance_eval(&block)
      rescue Exception => ex
        raise ex unless expected_value.is_a?(Class) && ex.is_a?(expected_value)
        assert_equal expected_value, ex.class
      end
    end 
  end
end

class Test::Unit::TestCase
  def assert_array_equal a, b
    assert_equal Set.new(a), Set.new(b)
  end
end

class Array
  def to_blank_options_hash
    self.inject({}) {|hash, value| hash[value] = nil; hash }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
jnunemaker-validatable-1.8.3 test/test_helper.rb
jnunemaker-validatable-1.8.2 test/test_helper.rb
jnunemaker-validatable-1.1.10 test/test_helper.rb
jnunemaker-validatable-1.1.9 test/test_helper.rb
jnunemaker-validatable-1.8.1 test/test_helper.rb
jnunemaker-validatable-1.8.0 test/test_helper.rb