Class: XMP2Assert::Converter
- Inherits:
-
Object
- Object
- XMP2Assert::Converter
- Defined in:
- lib/xmp2assert/converter.rb
Overview
This class converts a Ruby script into assertions
Class Method Summary collapse
-
.convert(obj, file = nil, line = nil) ⇒ (Quasifile,String,String,String)
Detects XMP and make them assertions.
Class Method Details
.convert(obj, file = nil, line = nil) ⇒ (Quasifile,String,String,String)
Detects XMP and make them assertions. For example:
def foo; 2; end
1 + foo # => 3
would become
def foo; 2; end
(1 + foo).tap {|i| assert_xmp("3", i ) }
51 52 53 54 |
# File 'lib/xmp2assert/converter.rb', line 51 def self.convert obj, file = nil, line = nil this = new obj, file, line return this.send :convert end |