Class: Neospec
- Inherits:
-
Object
- Object
- Neospec
- Defined in:
- lib/neospec.rb,
lib/neospec/spec.rb,
lib/neospec/color.rb,
lib/neospec/suite.rb,
lib/neospec/results.rb,
lib/neospec/version.rb,
lib/neospec/expector.rb,
lib/neospec/spec/result.rb,
lib/neospec/logger/basic.rb,
lib/neospec/report/basic.rb,
lib/neospec/runner/basic.rb,
lib/neospec/logger/symbols.rb,
lib/neospec/spec/result/failure.rb,
lib/neospec/expector/error_expectors.rb,
lib/neospec/report/buildkite_analytics.rb,
lib/neospec/expector/equality_expectors.rb,
lib/neospec/expector/inclusion_expectors.rb,
lib/neospec/spec/result/failure_encountered_error.rb
Defined Under Namespace
Modules: Color, Logger, Report, Runner Classes: Expector, Results, Spec, Suite
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#reporters ⇒ Object
Returns the value of attribute reporters.
-
#suites ⇒ Object
Returns the value of attribute suites.
Instance Method Summary collapse
-
#initialize(suites: [], logger: Neospec::Logger::Basic.new, reporters: [Neospec::Report::Basic]) ⇒ Neospec
constructor
A new instance of Neospec.
- #run ⇒ Object
- #run! ⇒ Object
Constructor Details
#initialize(suites: [], logger: Neospec::Logger::Basic.new, reporters: [Neospec::Report::Basic]) ⇒ Neospec
Returns a new instance of Neospec.
30 31 32 33 34 35 36 37 38 |
# File 'lib/neospec.rb', line 30 def initialize( suites: [], logger: Neospec::Logger::Basic.new, reporters: [Neospec::Report::Basic] ) @suites = suites @logger = logger @reporters = reporters end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
28 29 30 |
# File 'lib/neospec.rb', line 28 def logger @logger end |
#reporters ⇒ Object
Returns the value of attribute reporters.
28 29 30 |
# File 'lib/neospec.rb', line 28 def reporters @reporters end |
#suites ⇒ Object
Returns the value of attribute suites.
28 29 30 |
# File 'lib/neospec.rb', line 28 def suites @suites end |
Instance Method Details
#run ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/neospec.rb', line 40 def run @suites.each { |suite| suite.run(logger: logger) } results = Neospec::Results.new(suites: @suites) reporters.each { |reporter| reporter.call(results) } results.successful? end |
#run! ⇒ Object
52 53 54 |
# File 'lib/neospec.rb', line 52 def run! exit 1 unless run end |