Sha256: 7f4b1193f68d6a3123b0fa6d4a7faa6ddadbba31c4b84750009b0b07ae4253c6
Contents?: true
Size: 441 Bytes
Versions: 16
Compression:
Stored size: 441 Bytes
Contents
package factergo import ( "encoding/json" "testing" ) func Test_GetFacts(t *testing.T) { facts, fErr := GetFacts() if fErr != nil { t.Fatalf("Error thrown while retrieving facts: %v", fErr) } var decodedJSON map[string]interface{} jErr := json.Unmarshal([]byte(facts), &decodedJSON) if jErr != nil { t.Fatal("Facts are not in a valid JSON format") } if len(decodedJSON) == 0 { t.Fatal("Failed to gather any fact") } }
Version data entries
16 entries across 16 versions & 2 rubygems