diff --git a/lib/pdk/report/event.rb b/lib/pdk/report/event.rb index 6585e5939..c2930af00 100644 --- a/lib/pdk/report/event.rb +++ b/lib/pdk/report/event.rb @@ -53,7 +53,7 @@ class Event # @raise [ArgumentError] (see #sanitise_data) def initialize(data) sanitise_data(data).each do |key, value| - instance_variable_set("@#{key}", value) + instance_variable_set(:"@#{key}", value) end end diff --git a/spec/unit/pdk/report/event_spec.rb b/spec/unit/pdk/report/event_spec.rb index 160e32999..ec877b789 100644 --- a/spec/unit/pdk/report/event_spec.rb +++ b/spec/unit/pdk/report/event_spec.rb @@ -140,9 +140,9 @@ methods.each do |method| if method == state_method - it { is_expected.to send("be_#{method}") } + it { is_expected.to send(:"be_#{method}") } else - it { is_expected.not_to send("be_#{method}") } + it { is_expected.not_to send(:"be_#{method}") } end end end