Compare commits

...

2 Commits

Author SHA1 Message Date
Sijawusz Pur Rahnama f12e7f6c5d Add spec 2024-04-17 23:43:03 +02:00
Sijawusz Pur Rahnama 1bd59c1bf0 Make `GlobUtils` extend `self` for easier access 2024-04-17 23:42:05 +02:00
2 changed files with 9 additions and 5 deletions

View File

@ -1,11 +1,7 @@
require "../spec_helper"
module Ameba
struct GlobUtilsClass
include GlobUtils
end
subject = GlobUtilsClass.new
subject = GlobUtils
current_file_basename = File.basename(__FILE__)
current_file_path = "spec/ameba/#{current_file_basename}"
@ -45,6 +41,12 @@ module Ameba
subject.expand(["**/#{current_file_basename}", "**/#{current_file_basename}"])
.should eq [current_file_path]
end
it "does not list folders" do
subject.expand(["**/*"]).each do |path|
fail "#{path.inspect} should be a file" unless File.file?(path)
end
end
end
end
end

View File

@ -1,6 +1,8 @@
module Ameba
# Helper module that is utilizes helpers for working with globs.
module GlobUtils
extend self
# Returns all files that match specified globs.
# Globs can have wildcards or be rejected:
#