Skip to content

Commit

Permalink
updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
hexdigest committed Jan 9, 2019
1 parent 89749fc commit 89966b5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cmd/minimock/minimock.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/gojuno/minimock"
)

const version = "1.9"
const version = "1.9.1"

type (
programOptions struct {
Expand Down Expand Up @@ -369,7 +369,7 @@ const template = `
}
{{if gt (len (results $method)) 0 }}
// Return sets up return arguments of expectation struct for {{$interfaceName}}.{{$methodName}}
// Return sets up return arguments of expectation struct for {{$interfaceName}}.{{$methodName}}
func (e *{{$structName}}{{$methodName}}Expectation) Return({{results $method}}) {
e.result = &{{$structName}}{{$methodName}}Result{ {{ (results $method).Names }} }
}
Expand All @@ -392,7 +392,7 @@ const template = `
if len(m.{{$methodName}}Mock.expectationSeries) > 0 {
if counter > uint64(len(m.{{$methodName}}Mock.expectationSeries)) {
m.t.Fatalf("Unexpected call to {{$structName}}.{{$methodName}}.{{range (params $method)}} %v{{end}}", {{ (params $method).Names }} )
return
return
}
{{if gt (len (params $method)) 0 }}
Expand All @@ -402,11 +402,11 @@ const template = `
{{if gt (len (results $method)) 0 }}
result := m.{{$methodName}}Mock.expectationSeries[counter-1].result
if result == nil {
m.t.Fatal("No results are set for the {{$structName}}.{{$methodName}}")
if result == nil {
m.t.Fatal("No results are set for the {{$structName}}.{{$methodName}}")
return
}
{{ range $param := (results $method) }}
{{ range $param := (results $method) }}
{{ $param.Name }} = result.{{ $param.Name }} {{ end }}
{{ end }}
return
Expand All @@ -423,9 +423,9 @@ const template = `
{{if gt (len (results $method)) 0 }}
result := m.{{$methodName}}Mock.mainExpectation.result
if result == nil {
m.t.Fatal("No results are set for the {{$structName}}.{{$methodName}}")
m.t.Fatal("No results are set for the {{$structName}}.{{$methodName}}")
}
{{ range $param := (results $method) }}
{{ range $param := (results $method) }}
{{ $param.Name }} = result.{{ $param.Name }} {{ end }}
{{ end }}
return
Expand Down Expand Up @@ -513,7 +513,7 @@ const template = `
timeoutCh := time.After(timeout)
for {
ok := true
{{ range $methodName, $method := . }}ok = ok && m.{{$methodName}}Finished()
{{ range $methodName, $method := . }}ok = ok && m.{{$methodName}}Finished()
{{ end }}
if ok {
Expand Down

0 comments on commit 89966b5

Please sign in to comment.