mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
39 lines
989 B
Crystal
39 lines
989 B
Crystal
require "../spec_helper"
|
|
|
|
module Ameba
|
|
struct GlobUtilsClass
|
|
include GlobUtils
|
|
end
|
|
|
|
subject = GlobUtilsClass.new
|
|
current_file_basename = File.basename(__FILE__)
|
|
current_file_path = "spec/ameba/#{current_file_basename}"
|
|
|
|
describe GlobUtils do
|
|
describe "#find_files_by_globs" do
|
|
it "returns a file by globs" do
|
|
subject.find_files_by_globs(["**/#{current_file_basename}"])
|
|
.should eq [current_file_path]
|
|
end
|
|
|
|
it "returns files by globs" do
|
|
subject.find_files_by_globs(["**/*_spec.cr"])
|
|
.should contain current_file_path
|
|
end
|
|
|
|
it "doesn't return rejected globs" do
|
|
subject
|
|
.find_files_by_globs(["**/*_spec.cr", "!**/#{current_file_basename}"])
|
|
.should_not contain current_file_path
|
|
end
|
|
end
|
|
|
|
describe "#expand" do
|
|
it "expands globs" do
|
|
subject.expand(["**/#{current_file_basename}"])
|
|
.should eq [current_file_path]
|
|
end
|
|
end
|
|
end
|
|
end
|