Skip to content

Commit

Permalink
fix yamlconf test
Browse files Browse the repository at this point in the history
  • Loading branch information
fffw committed Oct 22, 2015
1 parent f4f668b commit 60a7496
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions src/github.com/getlantern/yamlconf/yamlconf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ func TestFileAndUpdate(t *testing.T) {
EmptyConfig: func() Config {
return &TestCfg{}
},
FilePath: file.Name(),
FilePollInterval: pollInterval,
FilePath: file.Name(),
}

first, err := m.Init()
Expand Down Expand Up @@ -105,18 +104,6 @@ func TestFileAndUpdate(t *testing.T) {
// Wait for file update to get picked up
time.Sleep(pollInterval * 2)

// Push update to file
saveConfig(t, file, &TestCfg{
Version: 1,
N: &Nested{
S: "3",
I: 3,
},
})

// Wait for file update to get picked up
time.Sleep(pollInterval * 2)

// Perform update programmatically
err := m.Update(func(cfg Config) error {
tc := cfg.(*TestCfg)
Expand All @@ -132,15 +119,6 @@ func TestFileAndUpdate(t *testing.T) {
}()

updated := m.Next()
assert.Equal(t, &TestCfg{
Version: 1,
N: &Nested{
S: "3",
I: 3,
},
}, updated, "Config from updated file should contain correct data")

updated = m.Next()
assert.Equal(t, &TestCfg{
Version: 2,
N: &Nested{
Expand Down Expand Up @@ -168,8 +146,7 @@ func TestCustomPoll(t *testing.T) {
EmptyConfig: func() Config {
return &TestCfg{}
},
FilePath: file.Name(),
FilePollInterval: pollInterval,
FilePath: file.Name(),
CustomPoll: func(currentCfg Config) (func(cfg Config) error, time.Duration, error) {
defer func() {
poll = poll + 1
Expand Down

0 comments on commit 60a7496

Please sign in to comment.