Skip to content

Commit 44b7162

Browse files
author
Ciro S. Costa
authored
Fixes wrong json key name (idletimelimit) (#9)
- Updates cast decoding test to include all optional fields
1 parent 2010943 commit 44b7162

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cast/cast.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type Header struct {
6565

6666
// IdleTimeLimit specifies the maximum amount of idleness between
6767
// one command and another.
68-
IdleTimeLimit float64 `json:"title,omitempty"`
68+
IdleTimeLimit float64 `json:"idle_time_limit,omitempty"`
6969

7070
// Env specifies a map of environment variables captured by the
7171
// asciinema command.

cast/cast_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ var _ = Describe("Cast", func() {
383383
)
384384

385385
BeforeEach(func() {
386-
reader = bytes.NewBufferString(`{"version": 2, "width":123}
386+
reader = bytes.NewBufferString(`{"version": 2, "width":123, "idle_time_limit": 1, "timestamp": 2, "command": "/bin/sh", "title": "test", "env": {"SHELL": "/bin/sh", "TERM": "a-term256"}, "theme": { "fg": "#aaa", "bg":"#bbb", "palette": "a,b,c" }}
387387
[1,"o", "lol"]
388388
[2,"o", "lol"]`)
389389
decodedCast, err = cast.Decode(reader)

0 commit comments

Comments
 (0)