Class: MiniTest::Unit::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest/should_syntax.rb

Overview

Patch TestCase::before_setup to invoke ShouldSyntax, and inject the #msg and #otherwise helper.

Instance Method Summary collapse

Instance Method Details

#before_setup(*a, &block) ⇒ Object



158
159
160
161
# File 'lib/minitest/should_syntax.rb', line 158

def before_setup(*a, &block)
  MiniTest::ShouldSyntax.init self
  mts_before_setup(*a, &block)
end

#msg(string = nil) ⇒ Object



163
164
165
166
# File 'lib/minitest/should_syntax.rb', line 163

def msg(string=nil)
  self.msg = string if string
  @msg
end

#msg=(string) ⇒ Object



168
169
170
# File 'lib/minitest/should_syntax.rb', line 168

def msg=(string)
  @msg = string
end

#mts_before_setupObject



156
# File 'lib/minitest/should_syntax.rb', line 156

alias :mts_before_setup :before_setup

#otherwise(message) ⇒ Object



172
173
174
# File 'lib/minitest/should_syntax.rb', line 172

def otherwise(message)
  msg message
end