lib/spectus/expectation_target.rb in spectus-2.9.1 vs lib/spectus/expectation_target.rb in spectus-2.9.2
- old
+ new
@@ -9,23 +9,13 @@
# Create a new expection target
#
# @param subject [Proc] The value which is compared with the expected value.
def initialize(&subject)
@subject = subject
- @challenges = [::Defi.send(:call)]
+ @challenges = [block_challenge]
end
- # @!attribute [r] subject
- #
- # @return [BasicObject] The front object to be tested.
- attr_reader :subject
-
- # @!attribute [r] challenges
- #
- # @return [Array] The challenges to call on the subject.
- attr_reader :challenges
-
# rubocop:disable Style/MethodName
# This word, or the terms "REQUIRED" or "SHALL", mean that the
# definition is an absolute requirement of the specification.
#
@@ -143,9 +133,28 @@
#
# @see MAY
def MAY!(req)
RequirementLevel::Low.new(req, false, subject, *challenges).result(true)
end
+
+ private
+
+ # The challenge for blocks.
+ #
+ # @return [Defi] The challenge for blocks.
+ def block_challenge
+ ::Defi.send(:call)
+ end
+
+ # @!attribute [r] subject
+ #
+ # @return [BasicObject] The front object to be tested.
+ attr_reader :subject
+
+ # @!attribute [r] challenges
+ #
+ # @return [Array] The challenges to call on the subject.
+ attr_reader :challenges
end
end
require_relative File.join 'requirement_level', 'high'
require_relative File.join 'requirement_level', 'medium'