Module: AssertGenerator
- Defined in:
- lib/assert_generator.rb
Defined Under Namespace
Classes: Klass
Class Method Summary collapse
-
.generate_asserts(source = nil, source_expr = nil, relative_dates: nil, numeric_precision: 2, &block) ⇒ Object
Generate asserts based on some actual output from an object under test Outputs executable code to stdout with the assert statements, which can be pasted into the test The user needs to ensure that values are deterministic and do not change between test invocations.
Class Method Details
.generate_asserts(source, source_expr) ⇒ Object .generate_asserts({ block }) { ... } ⇒ Object
Generate asserts based on some actual output from an object under test Outputs executable code to stdout with the assert statements, which can be pasted into the test The user needs to ensure that values are deterministic and do not change between test invocations
27 28 29 |
# File 'lib/assert_generator.rb', line 27 def self.generate_asserts(source = nil, source_expr = nil, relative_dates: nil, numeric_precision: 2, &block) AssertGenerator::Klass.new.send(:generate_asserts, source, source_expr, relative_dates, numeric_precision, block) end |