Module: Petitest::Spec
- Defined in:
- lib/petitest/spec.rb,
lib/petitest/spec/version.rb
Constant Summary collapse
- VERSION =
"0.3.2"
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(klass) ⇒ Object
Note:
Override
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/petitest/spec.rb', line 8 def extended(klass) klass.extend ::Petitest::DSL klass.singleton_class.class_eval do alias_method :context, :sub_test alias_method :describe, :sub_test alias_method :it, :test alias_method :specify, :test end end |
Instance Method Details
#let(method_name, &block) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/petitest/spec.rb', line 21 def let(method_name, &block) define_method(method_name) do @memoized_table ||= {} @memoized_table.fetch(method_name) do |key| @memoized_table[key] = instance_eval(&block) end end end |