Skip to content

Commit 9022a78

Browse files
committed
Merge branch 'issue/27/fix-user-agent-test' into issue/38/local-travis
2 parents 4df5323 + cf7bd6b commit 9022a78

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

project.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(defproject meson "0.1.0-SNAPSHOT"
22
:description "Clojure Client Library for the Mesos HTTP API"
3-
:url "https://github.com/oubiwann/meson"
3+
:url "https://github.com/clojusc/meson"
44
:license {:name "Apache License, Version 2.0"
55
:url "http://www.apache.org/licenses/LICENSE-2.0"}
66
:dependencies [[org.clojure/clojure "1.8.0"]

src/meson/client.clj

+6-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22
(:require [clojusc.twig :as logger]
33
[meson.const :as const]))
44

5-
(def user-agent (str "Meson REST Client/"
6-
const/client-version
7-
" (Clojure "
8-
const/clj-version
9-
"; Java "
10-
const/java-version
11-
") (+"
12-
const/project-url
13-
")"))
5+
(def user-agent
6+
(format "Meson REST Client/%s (Clojure %s; Java %s) (+%s)"
7+
const/client-version
8+
const/clj-version
9+
const/java-version
10+
const/project-url))
1411

1512
(def fields
1613
"Fields are maintained separately from the record so that they may be

test/meson/client_test.clj

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
[meson.client :as client]))
44

55
(deftest user-agent
6-
(is (= client/user-agent
7-
(str "Meson REST Client/0.1.0-SNAPSHOT "
8-
"(Clojure 1.8.0; Java 1.8.0_45-internal) "
9-
"(+https://github.com/oubiwann/meson)"))))
6+
(is
7+
(not
8+
(nil?
9+
(re-matches
10+
#"Meson REST Client/.* \(Clojure .*; Java .*\) \(\+https://.*\)"
11+
client/user-agent)))))
1012

1113
(deftest ->base-client
1214
(let [c (client/->base-client)]
@@ -21,3 +23,4 @@
2123
(deftest get-url
2224
(let [c (client/->base-client {:master "myhost:8080"})]
2325
(is (= (client/get-url c) "http://myhost:8080/api/v1"))))
26+

0 commit comments

Comments
 (0)