2014-05-11 11:06:20 -04:00
|
|
|
module Mutant
|
|
|
|
module Rspec
|
|
|
|
# Rspec test abstraction
|
|
|
|
class Test < Mutant::Test
|
2014-05-22 22:33:15 -04:00
|
|
|
include Concord::Public.new(:strategy, :example_group)
|
2014-05-11 11:06:20 -04:00
|
|
|
|
2014-05-22 21:47:31 -04:00
|
|
|
PREFIX = :rspec
|
|
|
|
|
2014-05-11 11:06:20 -04:00
|
|
|
# Return subject identification
|
|
|
|
#
|
|
|
|
# @return [String]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def subject_identification
|
2014-05-27 09:23:08 -04:00
|
|
|
metadata = example_group.metadata
|
|
|
|
if strategy.rspec2?
|
|
|
|
metadata.fetch(:example_group).fetch(:full_description)
|
|
|
|
else
|
|
|
|
metadata.fetch(:full_description)
|
|
|
|
end
|
2014-05-11 11:06:20 -04:00
|
|
|
end
|
|
|
|
memoize :subject_identification
|
|
|
|
|
|
|
|
# Run test, return report
|
|
|
|
#
|
|
|
|
# @return [String]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def run
|
2014-05-22 22:33:15 -04:00
|
|
|
strategy.run(self)
|
2014-05-11 11:06:20 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end # Test
|
|
|
|
end # Rspec
|
|
|
|
end # Mutant
|