@@ -12,12 +12,12 @@ type VerifyOptions struct {
1212 fields map [string ]interface {}
1313}
1414
15- type fileOptions struct {
15+ type FileOptions struct {
1616 fields map [string ]interface {}
1717}
1818
19- func (v VerifyOptions ) ForFile () fileOptions {
20- return fileOptions {fields : v .fields }
19+ func (v VerifyOptions ) ForFile () FileOptions {
20+ return FileOptions {fields : v .fields }
2121}
2222
2323// Deprecated: Use `ForFile().WithExtension(extension)` instead.
@@ -30,16 +30,16 @@ func (v VerifyOptions) GetExtension() string {
3030 return v .ForFile ().GetExtension ()
3131}
3232
33- func (f fileOptions ) GetExtension () string {
33+ func (f FileOptions ) GetExtension () string {
3434 ext := getField (f .fields , "extWithDot" , ".txt" )
3535 return ext .(string )
3636}
3737
38- func (f fileOptions ) WithNamer (namer core.ApprovalNamerCreator ) VerifyOptions {
38+ func (f FileOptions ) WithNamer (namer core.ApprovalNamerCreator ) VerifyOptions {
3939 return NewVerifyOptions (f .fields , "namer" , namer )
4040}
4141
42- func (f fileOptions ) GetNamer () core.ApprovalNamerCreator {
42+ func (f FileOptions ) GetNamer () core.ApprovalNamerCreator {
4343 ext := getField (f .fields , "namer" , getApprovalNameCreator ())
4444 creator := ext .(core.ApprovalNamerCreator )
4545
@@ -58,7 +58,7 @@ func (v VerifyOptions) getField(key string, defaultValue interface{}) interface{
5858 return getField (v .fields , key , defaultValue )
5959}
6060
61- func (f fileOptions ) getField (key string , defaultValue interface {}) interface {} {
61+ func (f FileOptions ) getField (key string , defaultValue interface {}) interface {} {
6262 return getField (f .fields , key , defaultValue )
6363}
6464
@@ -78,26 +78,26 @@ func Options() VerifyOptions {
7878}
7979
8080// WithScrubber allows you to 'scrub' data within your test input and replace it with a static placeholder
81- func (v VerifyOptions ) WithScrubber (scrub scrubber ) VerifyOptions {
81+ func (v VerifyOptions ) WithScrubber (scrub Scrubber ) VerifyOptions {
8282 return NewVerifyOptions (v .fields , "scrubber" , scrub )
8383}
8484
8585// AddScrubber allows you to 'scrub' data within your test input and replace it with a static placeholder
86- func (v VerifyOptions ) AddScrubber (scrubfn scrubber ) VerifyOptions {
87- scrub := CreateMultiScrubber (v .getField ("scrubber" , CreateNoopScrubber ()).(scrubber ), scrubfn )
86+ func (v VerifyOptions ) AddScrubber (scrubfn Scrubber ) VerifyOptions {
87+ scrub := CreateMultiScrubber (v .getField ("scrubber" , CreateNoopScrubber ()).(Scrubber ), scrubfn )
8888 return v .WithScrubber (scrub )
8989}
9090
9191// WithExtension overrides the default file extension (.txt) for approval files.
92- func (f fileOptions ) WithExtension (extensionWithDot string ) VerifyOptions {
92+ func (f FileOptions ) WithExtension (extensionWithDot string ) VerifyOptions {
9393 if ! strings .HasPrefix (extensionWithDot , "." ) {
9494 extensionWithDot = "." + extensionWithDot
9595 }
9696 return NewVerifyOptions (f .fields , "extWithDot" , extensionWithDot )
9797}
9898
9999// WithAdditionalInformation allows adding additional information to the file name for parameterized tests.
100- func (f fileOptions ) WithAdditionalInformation (info string ) VerifyOptions {
100+ func (f FileOptions ) WithAdditionalInformation (info string ) VerifyOptions {
101101 return NewVerifyOptions (f .fields , "additionalInformation" , strings .ReplaceAll (info , " " , "_" ))
102102}
103103
@@ -107,7 +107,7 @@ func (v VerifyOptions) Scrub(reader io.Reader) (io.Reader, error) {
107107 return nil , err
108108 }
109109
110- scrub := v .getField ("scrubber" , CreateNoopScrubber ()).(scrubber )
110+ scrub := v .getField ("scrubber" , CreateNoopScrubber ()).(Scrubber )
111111 result := scrub (string (b ))
112112
113113 return strings .NewReader (result ), nil
0 commit comments