Module: Kernel
- Defined in:
- lib/dfect/mini.rb,
lib/dfect/spec.rb,
lib/dfect/unit.rb
Instance Method Summary collapse
- #after(what, &block) ⇒ Object
- #before(what, &block) ⇒ Object
- #describe(*args, &block) ⇒ Object (also: #context, #it)
- #setup(&block) ⇒ Object
- #teardown(&block) ⇒ Object
Instance Method Details
#after(what, &block) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/dfect/spec.rb', line 29 def after what, &block meth = case what when :each then :> when :all then :>> else raise ArgumentError, what end Dfect.send meth, &block end |
#before(what, &block) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dfect/spec.rb', line 18 def before what, &block meth = case what when :each then :< when :all then :<< else raise ArgumentError, what end Dfect.send meth, &block end |
#describe(*args, &block) ⇒ Object Also known as: context, it
11 12 13 |
# File 'lib/dfect/spec.rb', line 11 def describe *args, &block Dfect.D args.join(' '), &block end |