Skip to content

Commit 35b0d8f

Browse files
committed
Rename fakenewsbox to fakebox
1 parent 81375a0 commit 35b0d8f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Package fakenewsbox provides a client for accessing fakenewsbox services.
2-
package fakenewsbox
1+
// Package fakebox provides a client for accessing fakebox services.
2+
package fakebox
33

44
import (
55
"encoding/json"
@@ -114,9 +114,9 @@ func (c *Client) Info() (*boxutil.Info, error) {
114114
return &info, nil
115115
}
116116

117-
// Check passes the text from the Reader to fakenewsbox for analysis.
117+
// Check passes the text from the Reader to fakebox for analysis.
118118
func (c *Client) Check(title string, content string, u *url.URL) (*Analysis, error) {
119-
uu, err := url.Parse(c.addr + "/fakenewsbox/check")
119+
uu, err := url.Parse(c.addr + "/fakebox/check")
120120
if err != nil {
121121
return nil, err
122122
}
@@ -160,9 +160,9 @@ func (c *Client) Check(title string, content string, u *url.URL) (*Analysis, err
160160
}, nil
161161
}
162162

163-
// ErrNewsbox represents an error from fakenewsbox.
163+
// ErrNewsbox represents an error from fakebox.
164164
type ErrNewsbox string
165165

166166
func (e ErrNewsbox) Error() string {
167-
return "fakenewsbox: " + string(e)
167+
return "fakebox: " + string(e)
168168
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package fakenewsbox_test
1+
package fakebox_test
22

33
import (
44
"io"
@@ -7,7 +7,7 @@ import (
77
"net/url"
88
"testing"
99

10-
"github.com/machinebox/sdk-go/fakenewsbox"
10+
"github.com/machinebox/sdk-go/fakebox"
1111
"github.com/matryer/is"
1212
)
1313

@@ -122,15 +122,15 @@ func TestCheck(t *testing.T) {
122122
is := is.New(t)
123123
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
124124
is.Equal(r.Method, "POST")
125-
is.Equal(r.URL.Path, "/fakenewsbox/check")
125+
is.Equal(r.URL.Path, "/fakebox/check")
126126
is.Equal(r.Header.Get("Accept"), "application/json; charset=utf-8")
127127
io.WriteString(w, result)
128128
}))
129129
defer srv.Close()
130130
u, err := url.Parse("http://www.bbc.co.uk/news/technology-41011662")
131131
is.NoErr(err)
132132

133-
tb := fakenewsbox.New(srv.URL)
133+
tb := fakebox.New(srv.URL)
134134
res, err := tb.Check(`China relaunches world's fastest train`,
135135
`The top speed of the Fuxing or "rejuvenation" bullet trains was capped at 300km/h (186mph) in 2011 following two crashes that killed 40 people.
136136
From next week, some of the trains will once again be allowed to run at a higher speed of about 350 km/h.`,

0 commit comments

Comments
 (0)