free_mutant/lib/mutant/rspec/test.rb

37 lines
708 B
Ruby

module Mutant
module Rspec
# Rspec test abstraction
class Test < Mutant::Test
include Concord.new(:strategy, :example_group)
PREFIX = :rspec
# Return subject identification
#
# @return [String]
#
# @api private
#
def subject_identification
example_group.description
end
memoize :subject_identification
# Run test, return report
#
# @return [String]
#
# @api private
#
def run
flag = example_group.run(strategy.reporter)
Report.new(
test: self,
output: '',
success: flag
)
end
end # Test
end # Rspec
end # Mutant