Skip to content

Commit a1d518b

Browse files
authored
Fix typos (#813)
1 parent bb0e550 commit a1d518b

36 files changed

+175
-171
lines changed

CHANGELOG.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ Require Go 1.22+
322322

323323
### Features
324324

325-
Introducting [gcustom](https://onsi.github.io/gomega/#gcustom-a-convenient-mechanism-for-buildling-custom-matchers) - a convenient mechanism for building custom matchers.
325+
Introducing [gcustom](https://onsi.github.io/gomega/#gcustom-a-convenient-mechanism-for-buildling-custom-matchers) - a convenient mechanism for building custom matchers.
326326

327327
This is an RC release for `gcustom`. The external API may be tweaked in response to feedback however it is expected to remain mostly stable.
328328

@@ -461,7 +461,7 @@ These improvements are all documented in [Gomega's docs](https://onsi.github.io/
461461
- Fix max number of samples in experiments on non-64-bit systems. (#528) [1c84497]
462462
- Remove dependency on ginkgo v1.16.4 (#530) [4dea8d5]
463463
- Fix for Go 1.18 (#532) [56d2a29]
464-
- Document precendence of timeouts (#533) [b607941]
464+
- Document precedence of timeouts (#533) [b607941]
465465

466466
## 1.18.1
467467

@@ -478,7 +478,7 @@ These improvements are all documented in [Gomega's docs](https://onsi.github.io/
478478
## Fixes
479479
- Gomega now uses ioutil for Go 1.15 and lower (#492) - official support is only for the most recent two major versions of Go but this will unblock users who need to stay on older unsupported versions of Go. [c29c1c0]
480480

481-
## Maintenace
481+
## Maintenance
482482
- Remove Travis workflow (#491) [72e6040]
483483
- Upgrade to Ginkgo 2.0.0 GA [f383637]
484484
- chore: fix description of HaveField matcher (#487) [2b4b2c0]
@@ -726,7 +726,7 @@ Improvements:
726726

727727
- Added `BeSent` which attempts to send a value down a channel and fails if the attempt blocks. Can be paired with `Eventually` to safely send a value down a channel with a timeout.
728728
- `Ω`, `Expect`, `Eventually`, and `Consistently` now immediately `panic` if there is no registered fail handler. This is always a mistake that can hide failing tests.
729-
- `Receive()` no longer errors when passed a closed channel, it's perfectly fine to attempt to read from a closed channel so Ω(c).Should(Receive()) always fails and Ω(c).ShoudlNot(Receive()) always passes with a closed channel.
729+
- `Receive()` no longer errors when passed a closed channel, it's perfectly fine to attempt to read from a closed channel so Ω(c).Should(Receive()) always fails and Ω(c).ShouldNot(Receive()) always passes with a closed channel.
730730
- Added `HavePrefix` and `HaveSuffix` matchers.
731731
- `ghttp` can now handle concurrent requests.
732732
- Added `Succeed` which allows one to write `Ω(MyFunction()).Should(Succeed())`.
@@ -736,7 +736,7 @@ Improvements:
736736
- `ghttp` servers can take an `io.Writer`. `ghttp` will write a line to the writer when each request arrives.
737737
- Added `WithTransform` matcher to allow munging input data before feeding into the relevant matcher
738738
- Added boolean `And`, `Or`, and `Not` matchers to allow creating composite matchers
739-
- Added `gbytes.TimeoutCloser`, `gbytes.TimeoutReader`, and `gbytes.TimeoutWriter` - these are convenience wrappers that timeout if the underlying Closer/Reader/Writer does not return within the alloted time.
739+
- Added `gbytes.TimeoutCloser`, `gbytes.TimeoutReader`, and `gbytes.TimeoutWriter` - these are convenience wrappers that timeout if the underlying Closer/Reader/Writer does not return within the allotted time.
740740
- Added `gbytes.BufferReader` - this constructs a `gbytes.Buffer` that asynchronously reads the passed-in `io.Reader` into its buffer.
741741

742742
Bug Fixes:
@@ -781,7 +781,7 @@ New Matchers:
781781

782782
Updated Matchers:
783783

784-
- `Receive` matcher can take a matcher as an argument and passes only if the channel under test receives an objet that satisfies the passed-in matcher.
784+
- `Receive` matcher can take a matcher as an argument and passes only if the channel under test receives an object that satisfies the passed-in matcher.
785785
- Matchers that implement `MatchMayChangeInTheFuture(actual interface{}) bool` can inform `Eventually` and/or `Consistently` when a match has no chance of changing status in the future. For example, `Receive` returns `false` when a channel is closed.
786786

787787
Misc:

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3405,7 +3405,7 @@ Describe("server performance", func() {
34053405
baseline := cache.Load("performance regression test", 1)
34063406
if baseline == nil {
34073407
// this is the first run, let's store a baseline
3408-
cache.Save("performacne regression test", 1, experiment)
3408+
cache.Save("performance regression test", 1, experiment)
34093409
} else {
34103410
for _, m := range []string{"fetching one", "listing"} {
34113411
baselineStats := baseline.GetStats(m)

format/format.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var Indent = " "
5757

5858
var longFormThreshold = 20
5959

60-
// GomegaStringer allows for custom formating of objects for gomega.
60+
// GomegaStringer allows for custom formatting of objects for gomega.
6161
type GomegaStringer interface {
6262
// GomegaString will be used to custom format an object.
6363
// It does not follow UseStringerRepresentation value and will always be called regardless.

format/format_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ var _ = Describe("Format", func() {
165165
Expect(Message(3, "to be three.")).Should(Equal("Expected\n <int>: 3\nto be three."))
166166
})
167167

168-
It("should print out an indented formatted representation of the value and the message, and trucate it when too long", func() {
168+
It("should print out an indented formatted representation of the value and the message, and truncate it when too long", func() {
169169
tooLong := strings.Repeat("s", MaxLength+1)
170170
tooLongResult := strings.Repeat("s", MaxLength) + "...\n" + truncateHelpText
171171
Expect(Message(tooLong, "to be truncated")).Should(Equal("Expected\n <string>: " + tooLongResult + "\nto be truncated"))
172172
})
173173

174-
It("should print out an indented formatted representation of the value and the message, and not trucate it when MaxLength = 0", func() {
174+
It("should print out an indented formatted representation of the value and the message, and not truncate it when MaxLength = 0", func() {
175175
MaxLength = 0
176176
tooLong := strings.Repeat("s", MaxLength+1)
177177
Expect(Message(tooLong, "to be truncated")).Should(Equal("Expected\n <string>: " + tooLong + "\nto be truncated"))

gcustom/make_matcher.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func (c CustomGomegaMatcher) WithTemplate(templ string, data ...any) CustomGomeg
191191
/*
192192
WithPrecompiledTemplate returns a CustomGomegaMatcher configured to use the passed-in template. The template should be precompiled with gcustom.ParseTemplate().
193193
194-
As with WithTemplate() you can provide a single pice of additional data as an optional argument. This is accessed in the template via {{.Data}}
194+
As with WithTemplate() you can provide a single piece of additional data as an optional argument. This is accessed in the template via {{.Data}}
195195
*/
196196
func (c CustomGomegaMatcher) WithPrecompiledTemplate(templ *template.Template, data ...any) CustomGomegaMatcher {
197197
c.templateMessage = templ

gexec/session_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ var _ = Describe("Session", func() {
330330
errWriter = io.Discard
331331
})
332332

333-
It("executes succesfuly", func() {
333+
It("executes successfully", func() {
334334
Eventually(session).Should(Exit())
335335
})
336336
})
@@ -391,7 +391,7 @@ var _ = Describe("Session", func() {
391391
errWriter = io.Discard
392392
})
393393

394-
It("executes succesfuly", func() {
394+
It("executes successfully", func() {
395395
Eventually(session).Should(Exit())
396396
})
397397
})

ghttp/handlers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func (g GHTTPWithGomega) RespondWith(statusCode int, body interface{}, optionalH
251251
/*
252252
RespondWithPtr returns a handler that responds to a request with the specified status code and body
253253
254-
Unlike RespondWith, you pass RepondWithPtr a pointer to the status code and body allowing different tests
254+
Unlike RespondWith, you pass RespondWithPtr a pointer to the status code and body allowing different tests
255255
to share the same setup but specify different status codes and bodies.
256256
257257
Also, RespondWithPtr can be given an optional http.Header. The headers defined therein will be added to the response headers.

ghttp/test_server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ var _ = Describe("TestServer", func() {
7878
})
7979
})
8080

81-
Describe("closing server mulitple times", func() {
81+
Describe("closing server multiple times", func() {
8282
It("should not fail", func() {
8383
s.Close()
8484
Expect(s.Close).ShouldNot(Panic())

gmeasure/cache.go

+37-37
Original file line numberDiff line numberDiff line change
@@ -106,50 +106,50 @@ func (cache ExperimentCache) Clear() error {
106106
}
107107

108108
/*
109-
Load fetches an experiment from the cache. Lookup occurs by name. Load requires that the version numer in the cache is equal to or greater than the passed-in version.
109+
Load fetches an experiment from the cache. Lookup occurs by name. Load requires that the version number in the cache is equal to or greater than the passed-in version.
110110
111111
If an experiment with corresponding name and version >= the passed-in version is found, it is unmarshaled and returned.
112112
113113
If no experiment is found, or the cached version is smaller than the passed-in version, Load will return nil.
114114
115115
When paired with Ginkgo you can cache experiments and prevent potentially expensive recomputation with this pattern:
116116
117-
const EXPERIMENT_VERSION = 1 //bump this to bust the cache and recompute _all_ experiments
118-
119-
Describe("some experiments", func() {
120-
var cache gmeasure.ExperimentCache
121-
var experiment *gmeasure.Experiment
122-
123-
BeforeEach(func() {
124-
cache = gmeasure.NewExperimentCache("./gmeasure-cache")
125-
name := CurrentSpecReport().LeafNodeText
126-
experiment = cache.Load(name, EXPERIMENT_VERSION)
127-
if experiment != nil {
128-
AddReportEntry(experiment)
129-
Skip("cached")
130-
}
131-
experiment = gmeasure.NewExperiment(name)
132-
AddReportEntry(experiment)
133-
})
134-
135-
It("foo runtime", func() {
136-
experiment.SampleDuration("runtime", func() {
137-
//do stuff
138-
}, gmeasure.SamplingConfig{N:100})
139-
})
140-
141-
It("bar runtime", func() {
142-
experiment.SampleDuration("runtime", func() {
143-
//do stuff
144-
}, gmeasure.SamplingConfig{N:100})
145-
})
146-
147-
AfterEach(func() {
148-
if !CurrentSpecReport().State.Is(types.SpecStateSkipped) {
149-
cache.Save(experiment.Name, EXPERIMENT_VERSION, experiment)
150-
}
151-
})
152-
})
117+
const EXPERIMENT_VERSION = 1 //bump this to bust the cache and recompute _all_ experiments
118+
119+
Describe("some experiments", func() {
120+
var cache gmeasure.ExperimentCache
121+
var experiment *gmeasure.Experiment
122+
123+
BeforeEach(func() {
124+
cache = gmeasure.NewExperimentCache("./gmeasure-cache")
125+
name := CurrentSpecReport().LeafNodeText
126+
experiment = cache.Load(name, EXPERIMENT_VERSION)
127+
if experiment != nil {
128+
AddReportEntry(experiment)
129+
Skip("cached")
130+
}
131+
experiment = gmeasure.NewExperiment(name)
132+
AddReportEntry(experiment)
133+
})
134+
135+
It("foo runtime", func() {
136+
experiment.SampleDuration("runtime", func() {
137+
//do stuff
138+
}, gmeasure.SamplingConfig{N:100})
139+
})
140+
141+
It("bar runtime", func() {
142+
experiment.SampleDuration("runtime", func() {
143+
//do stuff
144+
}, gmeasure.SamplingConfig{N:100})
145+
})
146+
147+
AfterEach(func() {
148+
if !CurrentSpecReport().State.Is(types.SpecStateSkipped) {
149+
cache.Save(experiment.Name, EXPERIMENT_VERSION, experiment)
150+
}
151+
})
152+
})
153153
*/
154154
func (cache ExperimentCache) Load(name string, version int) *Experiment {
155155
path := filepath.Join(cache.Path, cache.hashOf(name)+CACHE_EXT)

gmeasure/cache_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ var _ = Describe("Cache", func() {
7777
Ω(cache.Clear()).Should(Succeed())
7878
})
7979

80-
It("returs nil when loading a non-existing experiment", func() {
80+
It("returns nil when loading a non-existing experiment", func() {
8181
Ω(cache.Load("floop", 17)).Should(BeNil())
8282
})
8383
})

gmeasure/experiment.go

+19-19
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Once measurements are complete, an Experiment can generate a comprehensive repor
2222
2323
Users can also access and analyze the resulting Measurements directly. Use Experiment.Get(NAME) to fetch the Measurement named NAME. This returned struct will have fields containing
2424
all the data points and annotations recorded by the experiment. You can subsequently fetch the Measurement.Stats() to get a Stats struct that contains basic statistical information about the
25-
Measurement (min, max, median, mean, standard deviation). You can order these Stats objects using RankStats() to identify best/worst performers across multpile experiments or measurements.
25+
Measurement (min, max, median, mean, standard deviation). You can order these Stats objects using RankStats() to identify best/worst performers across multiple experiments or measurements.
2626
27-
gmeasure also supports caching Experiments via an ExperimentCache. The cache supports storing and retreiving experiments by name and version. This allows you to rerun code without
27+
gmeasure also supports caching Experiments via an ExperimentCache. The cache supports storing and retrieving experiments by name and version. This allows you to rerun code without
2828
repeating expensive experiments that may not have changed (which can be controlled by the cache version number). It also enables you to compare new experiment runs with older runs to detect
2929
variations in performance/behavior.
3030
@@ -66,8 +66,8 @@ type SamplingConfig struct {
6666

6767
// The Units decorator allows you to specify units (an arbitrary string) when recording values. It is ignored when recording durations.
6868
//
69-
// e := gmeasure.NewExperiment("My Experiment")
70-
// e.RecordValue("length", 3.141, gmeasure.Units("inches"))
69+
// e := gmeasure.NewExperiment("My Experiment")
70+
// e.RecordValue("length", 3.141, gmeasure.Units("inches"))
7171
//
7272
// Units are only set the first time a value of a given name is recorded. In the example above any subsequent calls to e.RecordValue("length", X) will maintain the "inches" units even if a new set of Units("UNIT") are passed in later.
7373
type Units string
@@ -76,9 +76,9 @@ type Units string
7676
//
7777
// For example:
7878
//
79-
// e := gmeasure.NewExperiment("My Experiment")
80-
// e.RecordValue("length", 3.141, gmeasure.Annotation("bob"))
81-
// e.RecordValue("length", 2.71, gmeasure.Annotation("jane"))
79+
// e := gmeasure.NewExperiment("My Experiment")
80+
// e.RecordValue("length", 3.141, gmeasure.Annotation("bob"))
81+
// e.RecordValue("length", 2.71, gmeasure.Annotation("jane"))
8282
//
8383
// ...will result in a Measurement named "length" that records two values )[3.141, 2.71]) annotation with (["bob", "jane"])
8484
type Annotation string
@@ -88,11 +88,11 @@ type Annotation string
8888
//
8989
// For example:
9090
//
91-
// e := gmeasure.NewExperiment("My Experiment")
92-
// e.RecordValue("length", 3.141, gmeasure.Style("{{blue}}{{bold}}"))
93-
// e.RecordValue("length", 2.71)
94-
// e.RecordDuration("cooking time", 3 * time.Second, gmeasure.Style("{{red}}{{underline}}"))
95-
// e.RecordDuration("cooking time", 2 * time.Second)
91+
// e := gmeasure.NewExperiment("My Experiment")
92+
// e.RecordValue("length", 3.141, gmeasure.Style("{{blue}}{{bold}}"))
93+
// e.RecordValue("length", 2.71)
94+
// e.RecordDuration("cooking time", 3 * time.Second, gmeasure.Style("{{red}}{{underline}}"))
95+
// e.RecordDuration("cooking time", 2 * time.Second)
9696
//
9797
// will emit a report with blue bold entries for the length measurement and red underlined entries for the cooking time measurement.
9898
//
@@ -112,11 +112,11 @@ type PrecisionBundle struct {
112112
//
113113
// For example:
114114
//
115-
// e := gmeasure.NewExperiment("My Experiment")
116-
// e.RecordValue("length", 3.141, gmeasure.Precision(2))
117-
// e.RecordValue("length", 2.71)
118-
// e.RecordDuration("cooking time", 3214 * time.Millisecond, gmeasure.Precision(100*time.Millisecond))
119-
// e.RecordDuration("cooking time", 2623 * time.Millisecond)
115+
// e := gmeasure.NewExperiment("My Experiment")
116+
// e.RecordValue("length", 3.141, gmeasure.Precision(2))
117+
// e.RecordValue("length", 2.71)
118+
// e.RecordDuration("cooking time", 3214 * time.Millisecond, gmeasure.Precision(100*time.Millisecond))
119+
// e.RecordDuration("cooking time", 2623 * time.Millisecond)
120120
func Precision(p interface{}) PrecisionBundle {
121121
out := DefaultPrecisionBundle
122122
switch reflect.TypeOf(p) {
@@ -308,7 +308,7 @@ The resulting durations are recorded on a Duration Measurement with the passed-i
308308
309309
The callback is given a zero-based index that increments by one between samples. The callback must return an Annotation - this annotation is attached to the measured duration.
310310
311-
The Sampling is configured via the passed-in SamplingConfig
311+
# The Sampling is configured via the passed-in SamplingConfig
312312
313313
SampleAnnotatedDuration supports the Style() and Precision() decorations.
314314
*/
@@ -395,7 +395,7 @@ SampleAnnotatedValue samples the passed-in callback and records the return value
395395
396396
The callback is given a zero-based index that increments by one between samples. The callback must return a float64 and an Annotation - the annotation is attached to the recorded value.
397397
398-
The Sampling is configured via the passed-in SamplingConfig
398+
# The Sampling is configured via the passed-in SamplingConfig
399399
400400
SampleValue supports the Style(), Units(), and Precision() decorations.
401401
*/

gmeasure/experiment_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ var _ = Describe("Experiment", func() {
298298
}).Should(PanicWith("invalid precision type, must be time.Duration or int"))
299299
})
300300

301-
It("panics if an unrecognized argumnet is passed in", func() {
301+
It("panics if an unrecognized argument is passed in", func() {
302302
Ω(func() {
303303
e.RecordValue("sprockets", 2, "boom")
304304
}).Should(PanicWith(`unrecognized argument "boom"`))

gmeasure/rank.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (s *RankingCriteria) UnmarshalJSON(b []byte) error {
3434
func (s RankingCriteria) MarshalJSON() ([]byte, error) { return rcEnumSupport.MarshJSON(uint(s)) }
3535

3636
/*
37-
Ranking ranks a set of Stats by a specified RankingCritera. Use RankStats to create a Ranking.
37+
Ranking ranks a set of Stats by a specified RankingCriteria. Use RankStats to create a Ranking.
3838
3939
When using Ginkgo, you can register Rankings as Report Entries via AddReportEntry. This will emit a formatted table representing the Stats in rank-order when Ginkgo generates the report.
4040
*/

gmeasure/stats.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type Stats struct {
7575
// If Type is StatTypeValue then PrecisionBundle.ValueFormat is used to format any values before presentation
7676
PrecisionBundle PrecisionBundle
7777

78-
// N represents the total number of data points in the Meassurement from which this Stat is derived
78+
// N represents the total number of data points in the Measurement from which this Stat is derived
7979
N int
8080

8181
// If Type is StatTypeValue, ValueBundle will be populated with float64s representing this Stat's statistics
@@ -97,7 +97,7 @@ func (s Stats) String() string {
9797
// ValueFor returns the float64 value for a particular Stat. You should only use this if the Stats has Type StatsTypeValue
9898
// For example:
9999
//
100-
// median := experiment.GetStats("length").ValueFor(gmeasure.StatMedian)
100+
// median := experiment.GetStats("length").ValueFor(gmeasure.StatMedian)
101101
//
102102
// will return the median data point for the "length" Measurement.
103103
func (s Stats) ValueFor(stat Stat) float64 {
@@ -107,7 +107,7 @@ func (s Stats) ValueFor(stat Stat) float64 {
107107
// DurationFor returns the time.Duration for a particular Stat. You should only use this if the Stats has Type StatsTypeDuration
108108
// For example:
109109
//
110-
// mean := experiment.GetStats("runtime").ValueFor(gmeasure.StatMean)
110+
// mean := experiment.GetStats("runtime").ValueFor(gmeasure.StatMean)
111111
//
112112
// will return the mean duration for the "runtime" Measurement.
113113
func (s Stats) DurationFor(stat Stat) time.Duration {

0 commit comments

Comments
 (0)