Class: Test::Unit::TestCase

Inherits:
Object show all
Defined in:
lib/mack-notifier/testing.rb,
lib/gems/validatable-1.6.7/test/test_helper.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.expect(expected_value, &block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/gems/validatable-1.6.7/test/test_helper.rb', line 11

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

Instance Method Details

#assert_array_equal(a, b) ⇒ Object



24
25
26
# File 'lib/gems/validatable-1.6.7/test/test_helper.rb', line 24

def assert_array_equal a, b
  assert_equal Set.new(a), Set.new(b)
end

#run(result, &progress_block) ⇒ Object

We need to wrap the run method so we can do things like run a cleanup method if it exists



37
38
39
40
41
# File 'lib/mack-notifier/testing.rb', line 37

def run(result, &progress_block) # :nodoc:
  @__res = super_run(result)
  Mack::Notifier::DeliveryHandlers::Test::NotifierRegistry.reset!
  @__res
end