Skip to content

Commit

Permalink
Merge pull request #6 from brandur/rename
Browse files Browse the repository at this point in the history
Rename "stripelocal" to "stripe-mock"
  • Loading branch information
brandur authored Jul 26, 2017
2 parents 0c2387f + 791b524 commit 1c725bc
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 31 deletions.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
# stripelocal [![Build Status](https://travis-ci.org/brandur/stripelocal.svg?branch=master)](https://travis-ci.org/brandur/stripelocal)
# stripe-mock [![Build Status](https://travis-ci.org/brandur/stripe-mock.svg?branch=master)](https://travis-ci.org/brandur/stripe-mock)

A stub for the Stripe API powered by the OpenAPI specification that it
generates as an artifact.
stripe-mock is a mock HTTP server that responds like the real Stripe API. It can be used instead of Stripe's testmode to make test suites integrating with Stripe faster and less brittle.

Get it from Homebrew or download it [from the releases page][releases]:

``` sh
brew install brandur/stripelocal/stripelocal
brew install brandur/stripe-mock/stripe-mock

# start a stripelocal service at login
brew services start stripelocal
# start a stripe-mock service at login
brew services start stripe-mock

# upgrade if you already have it
brew upgrade stripelocal
brew upgrade stripe-mock
```

Or if you have Go installed you can build it:

``` sh
go get -u github.com/brandur/stripelocal
go get -u github.com/brandur/stripe-mock
```

Run it:

``` sh
stripelocal
stripe-mock
```

Then from another terminal:
Expand All @@ -33,7 +32,7 @@ Then from another terminal:
curl -i http://localhost:12111/v1/charges
```

By default, stripelocal runs on port 12111, but is configurable with the
By default, stripe-mock runs on port 12111, but is configurable with the
`-port` option.

## Development
Expand Down Expand Up @@ -91,7 +90,7 @@ goreleaser

[go-bindata]: https://github.com/jteeuwen/go-bindata
[goreleaser]: https://github.com/goreleaser/goreleaser
[releases]: https://github.com/brandur/stripelocal/releases
[releases]: https://github.com/brandur/stripe-mock/releases

<!--
# vim: set tw=79:
Expand Down
2 changes: 1 addition & 1 deletion generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sort"
"strings"

"github.com/brandur/stripelocal/spec"
"github.com/brandur/stripe-mock/spec"
)

var errExpansionNotSupported = fmt.Errorf("Expansion not supported")
Expand Down
2 changes: 1 addition & 1 deletion generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/brandur/stripelocal/spec"
"github.com/brandur/stripe-mock/spec"
assert "github.com/stretchr/testify/require"
)

Expand Down
14 changes: 7 additions & 7 deletions goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build:
binary: stripelocal
binary: stripe-mock
goos:
- windows
- darwin
Expand All @@ -10,9 +10,9 @@ build:
brew:
github:
owner: brandur
name: homebrew-stripelocal
homepage: "https://git.luolix.top.com/brandur/stripelocal"
description: "stripelocal is a server that can be run locally and which responds like the real Stripe API."
name: homebrew-stripe-mock
homepage: "https://git.luolix.top.com/brandur/stripe-mock"
description: "stripe-mock is a mock HTTP server that responds like the real Stripe API. It can be used instead of Stripe's testmode to make test suites integrating with Stripe faster and less brittle."

plist: |
<?xml version="1.0" encoding="UTF-8"?>
Expand All @@ -28,7 +28,7 @@ brew:
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/stripelocal</string>
<string>#{opt_bin}/stripe-mock</string>
<string>-port</string>
<string>12111</string>
</array>
Expand All @@ -37,8 +37,8 @@ brew:
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/stripelocal.log</string>
<string>#{var}/log/stripe-mock.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/stripelocal.log</string>
<string>#{var}/log/stripe-mock.log</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"net/http"
"strconv"

"github.com/brandur/stripelocal/spec"
"github.com/brandur/stripe-mock/spec"
)

const defaultPort = 12111
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"github.com/brandur/stripelocal/spec"
"github.com/brandur/stripe-mock/spec"
)

var chargeAllMethod *spec.Method
Expand Down
2 changes: 1 addition & 1 deletion param/coercer/coercer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package coercer
import (
"strconv"

"github.com/brandur/stripelocal/spec"
"github.com/brandur/stripe-mock/spec"
)

// CoerceParams coerces the types of certain parameters according to typing
Expand Down
2 changes: 1 addition & 1 deletion param/coercer/coercer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package coercer
import (
"testing"

"github.com/brandur/stripelocal/spec"
"github.com/brandur/stripe-mock/spec"
assert "github.com/stretchr/testify/require"
)

Expand Down
8 changes: 4 additions & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"strings"
"time"

"github.com/brandur/stripelocal/param/coercer"
"github.com/brandur/stripelocal/param/parser"
"github.com/brandur/stripelocal/spec"
"github.com/brandur/stripe-mock/param/coercer"
"github.com/brandur/stripe-mock/param/parser"
"github.com/brandur/stripe-mock/spec"
"github.com/lestrrat/go-jsschema"
"github.com/lestrrat/go-jsval"
"github.com/lestrrat/go-jsval/builder"
Expand Down Expand Up @@ -305,7 +305,7 @@ func writeResponse(w http.ResponseWriter, start time.Time, status int, data inte
return
}

w.Header().Set("Stripelocal-Version", version)
w.Header().Set("Stripe-Mock-Version", version)

w.WriteHeader(status)
_, err = w.Write(encodedData)
Expand Down
4 changes: 2 additions & 2 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"
"testing"

"github.com/brandur/stripelocal/spec"
"github.com/brandur/stripe-mock/spec"
assert "github.com/stretchr/testify/require"
)

Expand All @@ -21,7 +21,7 @@ func TestStubServer_SetsSpecialHeaders(t *testing.T) {

resp := w.Result()
assert.Equal(t, http.StatusNotFound, resp.StatusCode)
assert.Equal(t, version, resp.Header.Get("Stripelocal-Version"))
assert.Equal(t, version, resp.Header.Get("Stripe-Mock-Version"))
}

func TestStubServer_ParameterValidation(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@
"revisionTime": "2015-06-20T23:27:11Z"
}
],
"rootPath": "github.com/brandur/stripelocal"
"rootPath": "github.com/brandur/stripe-mock"
}

0 comments on commit 1c725bc

Please sign in to comment.