lib/sysdig/mock.rb in sysdig-0.1.0 vs lib/sysdig/mock.rb in sysdig-0.2.0

- old
+ new

@@ -1,10 +1,32 @@ class Sysdig::Mock + def self.reset! + super + + @id = 0 + end + def self.data @@data ||= Hash.new { |h,url| h[url] = { :alerts => {}, + :user_notifications => { + "email" => { + "enabled" => false, + "recipients" => [] + }, + "sns" => { + "enabled" => false, + "topics" => [] + }, + "pagerDuty" => { + "enabled" => false, + "integrated" => false, + "resolveOnOk" => false, + "connectUrl" => "https://connect.pagerduty.com/connect?vendor=x&callback=https://app.sysdigcloud.com/api/pagerDuty/callback/y/z" + } + } } } end attr_reader :url, :logger @@ -41,7 +63,12 @@ ).raise! end def data self.class.data[self.url] + end + + def serial_id + @id ||= 0 + @id += 1 end end