Class: Neospec::Suite

Inherits:
Object
  • Object
show all
Defined in:
lib/neospec/suite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runner: Neospec::Runner::Basic.new) ⇒ Suite

Returns a new instance of Suite.



5
6
7
8
# File 'lib/neospec/suite.rb', line 5

def initialize(runner: Neospec::Runner::Basic.new)
  @runner = runner
  @specs = []
end

Instance Attribute Details

#runnerObject

Returns the value of attribute runner.



3
4
5
# File 'lib/neospec/suite.rb', line 3

def runner
  @runner
end

#specsObject

Returns the value of attribute specs.



3
4
5
# File 'lib/neospec/suite.rb', line 3

def specs
  @specs
end

Instance Method Details

#describe(description, &block) ⇒ Object



14
15
16
17
18
19
# File 'lib/neospec/suite.rb', line 14

def describe(description, &block)
  @specs << Neospec::Spec.new(
    description: description,
    block: block
  )
end

#resultsObject



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

def results
  @specs.map(&:result)
end

#run(logger:) ⇒ Object



21
22
23
24
25
26
# File 'lib/neospec/suite.rb', line 21

def run(logger:)
  runner.run(
    logger: logger,
    suite: self
  )
end