1 module step_definitions.steps; 2 3 import cucumber.keywords : When, Then; 4 import requests : Request, Response; 5 import unit_threaded.assertions : should; 6 7 /// 8 Response response; 9 10 /// 11 @When("^the user sends a GET request to (?P<url>.*)$") 12 void sendAGetRequestTo(string url) 13 { 14 response = Request().get(url); 15 } 16 17 /// 18 @Then("^the response status should be (?P<code>[0-9]+)$") 19 void theResponseStatusShouldBe(int code) 20 { 21 response.code.should == code; 22 }