@@ -1093,6 +1093,60 @@ func TestMastodon(t *testing.T) {
10931093 },
10941094 want : "foo" ,
10951095 },
1096+ {
1097+ name : "default mastodon cw" ,
1098+ envs : map [string ]string {
1099+ "WAYBACK_MASTODON_CW" : "true" ,
1100+ },
1101+ call : func (t * testing.T , opts * Options , want string ) {
1102+ called := strconv .FormatBool (opts .MastodonCW ())
1103+ if called != want {
1104+ t .Errorf (`Unexpected get the mastodon cw status, got %v instead of %s` , called , want )
1105+ }
1106+ },
1107+ want : "true" ,
1108+ },
1109+ {
1110+ name : "specified mastodon cw" ,
1111+ envs : map [string ]string {
1112+ "WAYBACK_MASTODON_CW" : "false" ,
1113+ },
1114+ call : func (t * testing.T , opts * Options , want string ) {
1115+ called := strconv .FormatBool (opts .MastodonCW ())
1116+ if called != want {
1117+ t .Errorf (`Unexpected get the mastodon cw status, got %v instead of %s` , called , want )
1118+ }
1119+ },
1120+ want : "false" ,
1121+ },
1122+ {
1123+ name : "default mastodon cw text" ,
1124+ envs : map [string ]string {
1125+ "WAYBACK_MASTODON_CWTEXT" : "" ,
1126+ },
1127+ call : func (t * testing.T , opts * Options , want string ) {
1128+ opts .mastodon .cw = true
1129+ called := opts .MastodonCWText ()
1130+ if called != want {
1131+ t .Errorf (`Unexpected get the mastodon cw text, got %v instead of %s` , called , want )
1132+ }
1133+ },
1134+ want : defMastodonCWText ,
1135+ },
1136+ {
1137+ name : "specified mastodon cw text" ,
1138+ envs : map [string ]string {
1139+ "WAYBACK_MASTODON_CWTEXT" : "foo" ,
1140+ },
1141+ call : func (t * testing.T , opts * Options , want string ) {
1142+ opts .mastodon .cw = true
1143+ called := opts .MastodonCWText ()
1144+ if called != want {
1145+ t .Errorf (`Unexpected get the mastodon cw text, got %v instead of %s` , called , want )
1146+ }
1147+ },
1148+ want : "foo" ,
1149+ },
10961150 {
10971151 name : "publish to mastodon enabled" ,
10981152 envs : map [string ]string {
0 commit comments