diff --git a/lib/inspec/rspec_json_formatter.rb b/lib/inspec/rspec_json_formatter.rb index a3647ca50..8a3a281c3 100644 --- a/lib/inspec/rspec_json_formatter.rb +++ b/lib/inspec/rspec_json_formatter.rb @@ -107,7 +107,7 @@ class InspecRspecJson < InspecRspecMiniJson # rubocop:disable Metrics/ClassLengt # Called by the runner during example collection. def add_profile(profile) - profiles.push(profile) + @profiles.push(profile) end def stop(notification) @@ -124,8 +124,6 @@ class InspecRspecJson < InspecRspecMiniJson # rubocop:disable Metrics/ClassLengt private - attr_reader :profiles - def all_unique_controls Array(@all_controls).uniq end @@ -205,7 +203,7 @@ class InspecRspecJson < InspecRspecMiniJson # rubocop:disable Metrics/ClassLengt end def profiles_info - @profiles_info ||= profiles.map(&:info!).map(&:dup) + @profiles_info ||= @profiles.map(&:info!).map(&:dup) end def example2control(example)