Minor code-review change to ControlEvalContext

- Add comment describing describe
- Fixup to_s output to be more accurate

Signed-off-by: Steven Danna <steve@chef.io>
This commit is contained in:
Steven Danna 2016-09-05 09:28:50 +01:00
parent 9bb65bd60c
commit 30a23b1b85
No known key found for this signature in database
GPG key ID: 94DFB46E861A7DAE

View file

@ -60,7 +60,7 @@ module Inspec
end
def to_s
"Profile Context Run #{profile_name}"
"Control Evaluation Context (#{profile_name})"
end
define_method :profile_name do
@ -73,6 +73,12 @@ module Inspec
register_control(rule_class.new(id, profile_id, opts, &block))
end
#
# Describe allows users to write rspec-like bare describe
# blocks without declaring an inclosing control. Here, we
# generate a control for them automatically and then execute
# the describe block in the context of that control.
#
define_method :describe do |*args, &block|
loc = block_location(block, caller[0])
id = "(generated from #{loc} #{SecureRandom.hex})"