diff --git a/config/custom_dns_test.go b/config/custom_dns_test.go index 5c626d56..9d83b2bd 100644 --- a/config/custom_dns_test.go +++ b/config/custom_dns_test.go @@ -58,8 +58,10 @@ var _ = Describe("CustomDNSConfig", func() { cfg.LogConfig(logger) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("custom.domain = "))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("multiple.ips = "))) + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("custom.domain = "), + ContainSubstring("multiple.ips = "), + )) }) }) diff --git a/config/ecs_test.go b/config/ecs_test.go index b6165c6e..4ceb612d 100644 --- a/config/ecs_test.go +++ b/config/ecs_test.go @@ -76,11 +76,11 @@ var _ = Describe("ECS", func() { c.LogConfig(logger) Expect(hook.Calls).Should(HaveLen(4)) - Expect(hook.Messages).Should(SatisfyAll( - ContainElement(ContainSubstring("Use as client")), - ContainElement(ContainSubstring("Forward")), - ContainElement(ContainSubstring("IPv4 netmask")), - ContainElement(ContainSubstring("IPv6 netmask")), + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("Use as client"), + ContainSubstring("Forward"), + ContainSubstring("IPv4 netmask"), + ContainSubstring("IPv6 netmask"), )) }) }) diff --git a/config/filtering_test.go b/config/filtering_test.go index 4b4ce168..794cf126 100644 --- a/config/filtering_test.go +++ b/config/filtering_test.go @@ -47,9 +47,11 @@ var _ = Describe("FilteringConfig", func() { cfg.LogConfig(logger) Expect(hook.Calls).Should(HaveLen(3)) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("query types:"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring(" - AAAA"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring(" - MX"))) + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("query types:"), + ContainSubstring(" - AAAA"), + ContainSubstring(" - MX"), + )) }) }) }) diff --git a/config/hosts_file_test.go b/config/hosts_file_test.go index 4ff5d9c1..d364a646 100644 --- a/config/hosts_file_test.go +++ b/config/hosts_file_test.go @@ -53,8 +53,10 @@ var _ = Describe("HostsFileConfig", func() { cfg.LogConfig(logger) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("- file:///a/file/path"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("- 127.0.0.1 lo..."))) + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("- file:///a/file/path"), + ContainSubstring("- 127.0.0.1 lo..."), + )) }) }) @@ -70,8 +72,10 @@ var _ = Describe("HostsFileConfig", func() { Expect(migrated).Should(BeTrue()) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("hostsFile.loading.refreshPeriod"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("hostsFile.sources"))) + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("hostsFile.loading.refreshPeriod"), + ContainSubstring("hostsFile.sources"), + )) Expect(cfg.Sources).Should(Equal([]BytesSource{*cfg.Deprecated.Filepath})) Expect(cfg.Loading.RefreshPeriod).Should(Equal(*cfg.Deprecated.RefreshPeriod)) diff --git a/config/rewriter_test.go b/config/rewriter_test.go index a7414d56..4702c877 100644 --- a/config/rewriter_test.go +++ b/config/rewriter_test.go @@ -48,8 +48,10 @@ var _ = Describe("RewriterConfig", func() { cfg.LogConfig(logger) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("rules:"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("original2 ="))) + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("rules:"), + ContainSubstring("original2 ="), + )) }) }) }) diff --git a/config/upstreams_test.go b/config/upstreams_test.go index 60405e9c..6a2000d9 100644 --- a/config/upstreams_test.go +++ b/config/upstreams_test.go @@ -54,9 +54,11 @@ var _ = Describe("ParallelBestConfig", func() { cfg.LogConfig(logger) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("timeout:"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("groups:"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring(":host2:"))) + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("timeout:"), + ContainSubstring("groups:"), + ContainSubstring(":host2:"), + )) }) }) }) @@ -102,10 +104,12 @@ var _ = Describe("ParallelBestConfig", func() { cfg.LogConfig(logger) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("group: test"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("upstreams:"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring(":host1:"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring(":host2:"))) + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("group: test"), + ContainSubstring("upstreams:"), + ContainSubstring(":host1:"), + ContainSubstring(":host2:"), + )) }) }) }) diff --git a/e2e/metrics_test.go b/e2e/metrics_test.go index 7e9f3cd7..710a46d8 100644 --- a/e2e/metrics_test.go +++ b/e2e/metrics_test.go @@ -78,12 +78,11 @@ var _ = Describe("Metrics functional tests", func() { When("Some query results are cached", func() { BeforeEach(func(ctx context.Context) { Eventually(fetchBlockyMetrics).WithArguments(ctx, metricsURL). - Should( - SatisfyAll( - ContainElement("blocky_cache_entry_count 0"), - ContainElement("blocky_cache_hit_count 0"), - ContainElement("blocky_cache_miss_count 0"), - )) + Should(ContainElements( + "blocky_cache_entry_count 0", + "blocky_cache_hit_count 0", + "blocky_cache_miss_count 0", + )) }) It("Should increment cache counts", func(ctx context.Context) { @@ -98,12 +97,11 @@ var _ = Describe("Metrics functional tests", func() { )) Eventually(fetchBlockyMetrics).WithArguments(ctx, metricsURL). - Should( - SatisfyAll( - ContainElement("blocky_cache_entry_count 1"), - ContainElement("blocky_cache_hit_count 0"), - ContainElement("blocky_cache_miss_count 1"), - )) + Should(ContainElements( + "blocky_cache_entry_count 1", + "blocky_cache_hit_count 0", + "blocky_cache_miss_count 1", + )) }) By("Same query again, should increment the cache hit count", func() { @@ -115,12 +113,11 @@ var _ = Describe("Metrics functional tests", func() { )) Eventually(fetchBlockyMetrics).WithArguments(ctx, metricsURL). - Should( - SatisfyAll( - ContainElement("blocky_cache_entry_count 1"), - ContainElement("blocky_cache_hit_count 1"), - ContainElement("blocky_cache_miss_count 1"), - )) + Should(ContainElements( + "blocky_cache_entry_count 1", + "blocky_cache_hit_count 1", + "blocky_cache_miss_count 1", + )) }) }) }) @@ -128,11 +125,10 @@ var _ = Describe("Metrics functional tests", func() { When("Lists are loaded", func() { It("Should expose list cache sizes per group as metrics", func(ctx context.Context) { Eventually(fetchBlockyMetrics).WithArguments(ctx, metricsURL). - Should( - SatisfyAll( - ContainElement("blocky_blacklist_cache{group=\"group1\"} 1"), - ContainElement("blocky_blacklist_cache{group=\"group2\"} 3"), - )) + Should(ContainElements( + "blocky_blacklist_cache{group=\"group1\"} 1", + "blocky_blacklist_cache{group=\"group2\"} 3", + )) }) }) }) diff --git a/lists/list_cache_test.go b/lists/list_cache_test.go index d89c4943..3d920919 100644 --- a/lists/list_cache_test.go +++ b/lists/list_cache_test.go @@ -423,9 +423,11 @@ var _ = Describe("ListCache", func() { sut.LogConfig(logger) Expect(hook.Calls).ShouldNot(BeEmpty()) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("gr1:"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("gr2:"))) - Expect(hook.Messages).Should(ContainElement(ContainSubstring("TOTAL:"))) + Expect(hook.Messages).Should(ContainElements( + ContainSubstring("gr1:"), + ContainSubstring("gr2:"), + ContainSubstring("TOTAL:"), + )) }) })