Class: RLab::Assert::MinitestIntegration

Inherits:
Object
  • Object
show all
Defined in:
lib/rlab/assert/minitest_integration.rb

Defined Under Namespace

Classes: Observer

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mt_test) ⇒ MinitestIntegration

Returns a new instance of MinitestIntegration.



9
10
11
# File 'lib/rlab/assert/minitest_integration.rb', line 9

def initialize mt_test
  @mt_test = mt_test
end

Class Method Details

.load(mt_test) ⇒ Object



4
5
6
7
# File 'lib/rlab/assert/minitest_integration.rb', line 4

def self.load mt_test
  instance = new mt_test
  instance.load
end

Instance Method Details

#loadObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/rlab/assert/minitest_integration.rb', line 13

def load
  @mt_test.class_eval do
    instance_methods.map(&:to_s).each do |instance_method|
      next unless instance_method.match /^(?:assert|refute)/
      next if instance_method.match /^assertions/
      undef_method instance_method
    end
  end
  Syntax.infect @mt_test, :observer => Observer.new
end