From c3e8c15c6b8afd405ab835153612c03cd52e4d86 Mon Sep 17 00:00:00 2001 From: Kanezoh Date: Wed, 29 Dec 2021 17:23:42 +0900 Subject: [PATCH] add auth store test --- spec/http_auth_store_spec.cr | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 spec/http_auth_store_spec.cr diff --git a/spec/http_auth_store_spec.cr b/spec/http_auth_store_spec.cr new file mode 100644 index 0000000..6f566a4 --- /dev/null +++ b/spec/http_auth_store_spec.cr @@ -0,0 +1,13 @@ +require "./spec_helper" + +describe "Mechanize AuthStore test" do + it "add_auth" do + auth_store = Mechanize::HTTP::AuthStore.new + url = URI.parse("http://example.com/") + user = "kanezoh" + password = "password" + auth_store.add_auth(url, user, password) + auth_store.auth_accounts.size.should eq 1 + auth_store.auth_accounts[url].should eq({"kanezoh", "password"}) + end +end