Make the test expect_offense calls consistent with other tests

This commit is contained in:
Issy Long 2023-12-22 00:20:02 +00:00
parent f4754baa00
commit f34accfcde
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4

View File

@ -1,11 +1,10 @@
# frozen_string_literal: true # frozen_string_literal: true
require "rubocops/rubocop-cask" require "rubocops/rubocop-cask"
describe RuboCop::Cop::Cask::ArrayAlphabetization, :config do describe RuboCop::Cop::Cask::ArrayAlphabetization, :config do
it "reports an offense when a single `zap trash` path is specified in an array" do it "reports an offense when a single `zap trash` path is specified in an array" do
source = <<~CASK expect_offense(<<~CASK)
cask "foo" do cask "foo" do
url "https://example.com/foo.zip" url "https://example.com/foo.zip"
@ -14,7 +13,6 @@ describe RuboCop::Cop::Cask::ArrayAlphabetization, :config do
end end
CASK CASK
expect_offense(source)
expect_correction(<<~CASK) expect_correction(<<~CASK)
cask "foo" do cask "foo" do
url "https://example.com/foo.zip" url "https://example.com/foo.zip"
@ -25,7 +23,7 @@ describe RuboCop::Cop::Cask::ArrayAlphabetization, :config do
end end
it "reports an offense when the `zap trash` paths are not in alphabetical order" do it "reports an offense when the `zap trash` paths are not in alphabetical order" do
source = <<~CASK expect_offense(<<~CASK)
cask "foo" do cask "foo" do
url "https://example.com/foo.zip" url "https://example.com/foo.zip"
@ -41,7 +39,6 @@ describe RuboCop::Cop::Cask::ArrayAlphabetization, :config do
end end
CASK CASK
expect_offense(source)
expect_correction(<<~CASK) expect_correction(<<~CASK)
cask "foo" do cask "foo" do
url "https://example.com/foo.zip" url "https://example.com/foo.zip"