mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Conditionally add !lib to default globs
This commit is contained in:
parent
b2069ea4ff
commit
7690074cab
3 changed files with 24 additions and 8 deletions
|
@ -9,10 +9,20 @@ module Ameba
|
|||
end
|
||||
|
||||
describe ".new" do
|
||||
it "loads default globs when config is empty" do
|
||||
yml = YAML.parse "{}"
|
||||
config = Config.new(yml)
|
||||
config.globs.should eq Config::DEFAULT_GLOBS
|
||||
context "when config is empty" do
|
||||
it "loads default globs" do
|
||||
yml = YAML.parse "{}"
|
||||
config = Config.new(yml)
|
||||
config.globs.should eq ["**/*.cr"]
|
||||
end
|
||||
|
||||
it "only sets !lib as a default glob when there are .cr files in lib" do
|
||||
File.touch "lib/shard.cr"
|
||||
yml = YAML.parse "{}"
|
||||
config = Config.new(yml)
|
||||
config.globs.should eq Config::DEFAULT_GLOBS
|
||||
File.delete "lib/shard.cr"
|
||||
end
|
||||
end
|
||||
|
||||
it "initializes globs as string" do
|
||||
|
@ -102,7 +112,7 @@ module Ameba
|
|||
config = Config.load config_sample
|
||||
|
||||
it "holds source globs" do
|
||||
config.globs.should eq Config::DEFAULT_GLOBS
|
||||
config.globs.should eq ["**/*.cr"]
|
||||
end
|
||||
|
||||
it "allows to set globs" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue