Class: Minitest::Checks::Base
- Inherits:
-
Object
- Object
- Minitest::Checks::Base
- Defined in:
- lib/mimoco.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#klass_hash ⇒ Object
Returns the value of attribute klass_hash.
-
#minitest ⇒ Object
Returns the value of attribute minitest.
-
#where ⇒ Object
Returns the value of attribute where.
Class Method Summary collapse
- .check_equal(expected, actual, msg = nil) ⇒ Object
- .check_no_nil(actual, msg = nil) ⇒ Object
- .run(data, minitest) ⇒ Object
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
16 17 18 |
# File 'lib/mimoco.rb', line 16 def klass @klass end |
#klass_hash ⇒ Object
Returns the value of attribute klass_hash.
16 17 18 |
# File 'lib/mimoco.rb', line 16 def klass_hash @klass_hash end |
#minitest ⇒ Object
Returns the value of attribute minitest.
16 17 18 |
# File 'lib/mimoco.rb', line 16 def minitest @minitest end |
#where ⇒ Object
Returns the value of attribute where.
16 17 18 |
# File 'lib/mimoco.rb', line 16 def where @where end |
Class Method Details
.check_equal(expected, actual, msg = nil) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/mimoco.rb', line 30 def self.check_equal(expected, actual, msg = nil) expected = expected.sort.map(&:to_sym) actual = actual.sort.map(&:to_sym) msg = msg ? "#{@where}: #{msg}" : @where @minitest.assert_equal expected, actual, msg end |
.check_no_nil(actual, msg = nil) ⇒ Object
37 38 39 40 |
# File 'lib/mimoco.rb', line 37 def self.check_no_nil(actual, msg = nil) msg = msg ? "#{@where}: #{msg}" : @where @minitest.refute_nil actual, msg end |
.run(data, minitest) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mimoco.rb', line 18 def self.run(data, minitest) @minitest = minitest data.each do |klass, hash| @klass = klass @klass_hash = hash hash.each do |function, value| @where = "#{klass}##{function}" send(function, value) end end end |