Skip to content

Commit

Permalink
Update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Nov 4, 2023
1 parent 6848c75 commit bf87d9c
Show file tree
Hide file tree
Showing 17 changed files with 591 additions and 1,062 deletions.
5 changes: 5 additions & 0 deletions api/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"path/filepath"
"reflect"
"testing"

Expand Down Expand Up @@ -40,6 +41,10 @@ var _ = Describe("Health api test", func() {
spectest.New().
Report(spectest.SequenceDiagram(documentDirPath())).
CustomReportName("health_success").
Report(spectest.SequenceReport(spectest.ReportFormatterConfig{
Path: filepath.Join("..", "docs", "health"),
Kind: spectest.ReportKindMarkdown,
})).
Handler(api).
Get("/v1/health").
Expect(t).
Expand Down
5 changes: 5 additions & 0 deletions api/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"net/http"
"path/filepath"

"github.com/go-spectest/spectest"
. "github.com/onsi/ginkgo"
Expand All @@ -23,6 +24,10 @@ var _ = Describe("Network api test", func() {
spectest.New().
Report(spectest.SequenceDiagram(documentDirPath())).
CustomReportName("ip_success").
Report(spectest.SequenceReport(spectest.ReportFormatterConfig{
Path: filepath.Join("..", "docs", "network"),
Kind: spectest.ReportKindMarkdown,
})).
Handler(api).
Get("/v1/ip").
Headers(map[string]string{"X-Real-IP": "127.0.0.1"}).
Expand Down
8 changes: 8 additions & 0 deletions api/os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ var _ = Describe("OS api test", func() {
spectest.New().
Report(spectest.SequenceDiagram(documentDirPath())).
CustomReportName("android_success").
Report(spectest.SequenceReport(spectest.ReportFormatterConfig{
Path: filepath.Join("..", "docs", "os"),
Kind: spectest.ReportKindMarkdown,
})).
Handler(api).
Get("/v1/os/android").
Expect(t).
Expand All @@ -38,6 +42,10 @@ var _ = Describe("OS api test", func() {
spectest.New().
Report(spectest.SequenceDiagram(documentDirPath())).
CustomReportName("debian_success").
Report(spectest.SequenceReport(spectest.ReportFormatterConfig{
Path: filepath.Join("..", "docs", "os"),
Kind: spectest.ReportKindMarkdown,
})).
Handler(api).
Get("/v1/os/debian").
Expect(t).
Expand Down
5 changes: 5 additions & 0 deletions api/ulid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"io"
"net/http"
"path/filepath"
"testing"
"unicode/utf8"

Expand All @@ -15,6 +16,10 @@ func TestULID(t *testing.T) { //nolint
spectest.New().
Report(spectest.SequenceDiagram(documentDirPath())).
CustomReportName("ulid_success").
Report(spectest.SequenceReport(spectest.ReportFormatterConfig{
Path: filepath.Join("..", "docs", "id"),
Kind: spectest.ReportKindMarkdown,
})).
Handler(NewAPI()).
Get("/v1/ulid").
Expect(t).
Expand Down
Loading

0 comments on commit bf87d9c

Please sign in to comment.