Class: Oncall::Core::Scenario

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

Instance Method Summary collapse

Instance Method Details

#get(path, &block) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/oncall/core/scenario.rb', line 4

def get(path, &block)
  http = Net::HTTP.new('localhost', 4567)
  request = Net::HTTP::Get.new(path)
  response = http.request(request)

  assertion = Oncall::Core::Assertion.new(response)
  assertion.instance_exec(&block)
end