From c690b05d13f34a66a589429c71050ae24d912550 Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Tue, 8 Jun 2021 21:20:46 +0900 Subject: [PATCH] add webmock --- shard.yml | 5 +++++ spec/mechanize_spec.cr | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/shard.yml b/shard.yml index 6148732..1078ef5 100644 --- a/shard.yml +++ b/shard.yml @@ -11,3 +11,8 @@ license: MIT dependencies: myhtml: github: kostya/myhtml + +development_dependencies: + webmock: + github: manastech/webmock.cr + branch: master diff --git a/spec/mechanize_spec.cr b/spec/mechanize_spec.cr index 720f250..de1a32c 100644 --- a/spec/mechanize_spec.cr +++ b/spec/mechanize_spec.cr @@ -1,9 +1,13 @@ require "./spec_helper" +require "webmock" +WebMock.stub(:any, "example.com") describe Mechanize do # TODO: Write tests it "works" do - false.should eq(true) + response = HTTP::Client.get("http://example.com") + response.body.should eq "" + response.status_code.should eq 200 end end