Class: Oncall::Core::Assertion

Inherits:
Object
  • Object
show all
Defined in:
lib/oncall/core/assertion.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Assertion

Returns a new instance of Assertion.



4
5
6
7
# File 'lib/oncall/core/assertion.rb', line 4

def initialize(response)
  @reporter = Oncall::Core.reporter
  @response = response
end

Instance Method Details

#status(expected) ⇒ Object



9
10
11
12
# File 'lib/oncall/core/assertion.rb', line 9

def status(expected)
  result = @response.code == expected.to_s
  @reporter.report_status(result)
end