Module: Proof

Defined in:
lib/proof/error.rb,
lib/proof/proof.rb,
lib/proof/suite.rb,
lib/proof/extend.rb,
lib/proof/output.rb,
lib/proof/result.rb,
lib/proof/summary.rb,
lib/proof/execution.rb,
lib/proof/namespace.rb,
lib/proof/description.rb,
lib/proof/core_ext/object.rb

Defined Under Namespace

Modules: CoreExt, Namespace Classes: Description, Error, Execution, Extend, Output, Result, Suite, Summary

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.startObject



34
35
36
# File 'lib/proof/proof.rb', line 34

def self.start
  CoreExt::Object::Methods.define_prove
end

.stopObject



38
39
40
# File 'lib/proof/proof.rb', line 38

def self.stop
  CoreExt::Object::Methods.undefine_prove
end

Instance Method Details

#comment(comment) ⇒ Object



30
31
32
# File 'lib/proof/proof.rb', line 30

def comment(comment)
  Proof::Output.note comment
end

#desc(description) ⇒ Object



10
11
12
# File 'lib/proof/proof.rb', line 10

def desc(description)
  Proof::Description.current = description
end

#heading(heading) ⇒ Object



18
19
20
21
# File 'lib/proof/proof.rb', line 18

def heading(heading)
  Proof::Output.h2 heading
  yield if block_given?
end

#proof(description = nil, &block) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/proof/proof.rb', line 2

def proof(description=nil, &block)
  Proof::Description.current = description
  Proof.start
  yield
  Proof.stop
  Proof::Description.current = nil
end

#section(heading = '') ⇒ Object Also known as: block



23
24
25
26
27
# File 'lib/proof/proof.rb', line 23

def section(heading='')
  meth = heading.empty? ? :sect : :heading
  Proof::Output.send meth, heading
  yield if block_given?
end

#title(title) ⇒ Object



14
15
16
# File 'lib/proof/proof.rb', line 14

def title(title)
  Proof::Output.h1 title
end