Module: Riot
- Defined in:
- lib/riot.rb,
lib/riot/context.rb,
lib/riot/reporter.rb,
lib/riot/runnable.rb,
lib/riot/assertion.rb,
lib/riot/situation.rb,
lib/riot/assertion_macros.rb
Defined Under Namespace
Classes: Assertion, Context, DotMatrixReporter, IOReporter, Reporter, RootContext, RunnableBlock, Setup, SilentReporter, Situation, StoryReporter, VerboseStoryReporter
Class Method Summary
collapse
Class Method Details
.context(description, context_class = Context, &definition) ⇒ Object
9
10
11
|
# File 'lib/riot.rb', line 9
def self.context(description, context_class = Context, &definition)
root_contexts << context_class.new(description, &definition)
end
|
.reporter=(reporter_class) ⇒ Object
25
|
# File 'lib/riot.rb', line 25
def self.reporter=(reporter_class) @reporter_class = reporter_class; end
|
.root_contexts ⇒ Object
13
|
# File 'lib/riot.rb', line 13
def self.root_contexts; @root_contexts ||= []; end
|
15
16
17
18
19
20
|
# File 'lib/riot.rb', line 15
def self.run
the_reporter = reporter.new
the_reporter.summarize do
root_contexts.each { |ctx| ctx.run(the_reporter) }
end
end
|
.silently! ⇒ Object
22
|
# File 'lib/riot.rb', line 22
def self.silently!; @silent = true; end
|
.silently? ⇒ Boolean
23
|
# File 'lib/riot.rb', line 23
def self.silently?; defined?(@silent) && @silent == true end
|
TODO: make this a flag that DotMatrix and Story respect and cause them to print errors/failures