mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
27 lines
623 B
Crystal
27 lines
623 B
Crystal
require "../../../spec_helper"
|
|
|
|
module Ameba::Rule::Lint
|
|
subject = DuplicatedRequire.new
|
|
|
|
describe DuplicatedRequire do
|
|
it "passes if there are no duplicated requires" do
|
|
expect_no_issues subject, <<-CRYSTAL
|
|
require "math"
|
|
require "big"
|
|
require "big/big_decimal"
|
|
CRYSTAL
|
|
end
|
|
|
|
it "reports if there are a duplicated requires" do
|
|
source = expect_issue subject, <<-CRYSTAL
|
|
require "big"
|
|
require "math"
|
|
require "big"
|
|
# ^^^^^^^^^^^ error: Duplicated require of `big`
|
|
CRYSTAL
|
|
|
|
expect_no_corrections source
|
|
end
|
|
end
|
|
end
|