Module: Polyrun::Quick

Defined in:
lib/polyrun/quick/runner.rb,
lib/polyrun/quick/errors.rb,
lib/polyrun/quick/matchers.rb,
lib/polyrun/quick/reporter.rb,
lib/polyrun/quick/assertions.rb,
lib/polyrun/quick/example_group.rb,
lib/polyrun/quick/example_runner.rb

Overview

Micro test runner: nested describe, it / test, before / after, let / let!, expect().to matchers, optional Polyrun::Quick.capybara! when the capybara gem is loaded.

Run: polyrun quick or polyrun quick spec/foo.rb

Coverage: when POLYRUN_COVERAGE=1 or (config/polyrun_coverage.yml and POLYRUN_QUICK_COVERAGE=1), starts Coverage::Rails before loading quick files so stdlib Coverage records them.

Defined Under Namespace

Modules: Assertions, DSL, Matchers Classes: AssertionFailed, Collector, EqMatcher, Error, ExampleGroup, ExampleRunner, Expectation, FalseyMatcher, IncludeMatcher, RegexMatcher, Reporter, Runner, TruthyMatcher

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.collectorObject

Returns the value of attribute collector.



38
39
40
# File 'lib/polyrun/quick/runner.rb', line 38

def collector
  @collector
end

Class Method Details

.capybara!Object



40
41
42
# File 'lib/polyrun/quick/runner.rb', line 40

def capybara!
  @capybara_enabled = true
end

.capybara?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/polyrun/quick/runner.rb', line 44

def capybara?
  @capybara_enabled == true
end

.describe(name, &block) ⇒ Object



52
53
54
55
56
# File 'lib/polyrun/quick/runner.rb', line 52

def describe(name, &block)
  group = ExampleGroup.new(name)
  group.instance_eval(&block) if block
  (collector || raise(Error, "Polyrun::Quick.describe used outside polyrun quick")).register(group)
end

.reset_capybara_flag!Object



48
49
50
# File 'lib/polyrun/quick/runner.rb', line 48

def reset_capybara_flag!
  @capybara_enabled = false
end