Module: Specdown

Extended by:
Specdown
Included in:
Specdown
Defined in:
lib/specdown/node.rb,
lib/specdown/test.rb,
lib/specdown/tree.rb,
lib/specdown/config.rb,
lib/specdown/parser.rb,
lib/specdown/readme.rb,
lib/specdown/command.rb,
lib/specdown/pending.rb,
lib/specdown/reporter.rb,
lib/specdown/specdown.rb,
lib/specdown/event_server.rb,
lib/specdown/readme/stats.rb,
lib/specdown/implicit_parser.rb,
lib/specdown/sandbox_factory.rb,
lib/specdown/pending_exception.rb,
lib/specdown/command/option_parser.rb,
lib/specdown/readme/report_summary.rb,
lib/specdown/readme/exception_facade.rb,
lib/specdown/reporters/text_reporter.rb,
lib/specdown/reporters/terminal_reporter.rb,
lib/specdown/reporters/color_terminal_reporter.rb

Defined Under Namespace

Modules: Config, EventServer, OptionParser, Pending, Reporter, SandboxFactory Classes: ColorTerminalReporter, Command, ExceptionFacade, ImplicitParser, Node, Parser, PendingException, Readme, ReportSummary, Stats, TerminalReporter, Test, TextReporter, Tree

Instance Method Summary collapse

Instance Method Details

#after(*filters, &callback) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/specdown/specdown.rb', line 24

def after(*filters, &callback)
  Specdown::Test.hook_after(:execute) do |test|
    if filters.empty? || filters.any? {|filter| filter.match test.readme.file_name}
      callback.call
    end
  end
end

#around(*filters, &callback) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/specdown/specdown.rb', line 32

def around(*filters, &callback)
  Specdown::Test.hook_around(:execute) do |test|
    if filters.empty? || filters.any? {|filter| filter.match test.readme.file_name}
      callback.call
    end
  end
end

#before(*filters, &callback) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/specdown/specdown.rb', line 16

def before(*filters, &callback)
  Specdown::Test.hook_before(:execute) do |test|
    if filters.empty? || filters.any? {|filter| filter.match test.readme.file_name}
      callback.call
    end
  end
end

#reporterObject



12
13
14
# File 'lib/specdown/specdown.rb', line 12

def reporter
  @reporter ||= Config.reporter.new
end

#reset!Object



4
5
6
# File 'lib/specdown/specdown.rb', line 4

def reset!
  Config.reset!
end

#sandboxObject



8
9
10
# File 'lib/specdown/specdown.rb', line 8

def sandbox
  SandboxFactory.generate
end