Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

141 lines
2.5 KiB
Nix

{
lib,
ruby,
defaultGemConfig,
test,
should,
}:
let
testConfigs = {
inherit lib;
gemConfig = defaultGemConfig;
};
functions = (import ./functions.nix testConfigs);
in
builtins.concatLists [
(test.run "All set, no gemdir"
(functions.bundlerFiles {
gemfile = test/Gemfile;
lockfile = test/Gemfile.lock;
gemset = test/gemset.nix;
})
{
gemfile = should.equal test/Gemfile;
lockfile = should.equal test/Gemfile.lock;
gemset = should.equal test/gemset.nix;
}
)
(test.run "Just gemdir"
(functions.bundlerFiles {
gemdir = test/.;
})
{
gemfile = should.equal test/Gemfile;
lockfile = should.equal test/Gemfile.lock;
gemset = should.equal test/gemset.nix;
}
)
(test.run "Gemset and dir"
(functions.bundlerFiles {
gemdir = test/.;
gemset = test/extraGemset.nix;
})
{
gemfile = should.equal test/Gemfile;
lockfile = should.equal test/Gemfile.lock;
gemset = should.equal test/extraGemset.nix;
}
)
(test.run "Filter empty gemset" { } (
set:
functions.filterGemset {
inherit ruby;
groups = [ "default" ];
} set == { }
))
(
let
gemSet = {
test = {
groups = [
"x"
"y"
];
};
};
in
test.run "Filter matches a group" gemSet (
set:
functions.filterGemset {
inherit ruby;
groups = [
"y"
"z"
];
} set == gemSet
)
)
(
let
gemSet = {
test = {
platforms = [ ];
};
};
in
test.run "Filter matches empty platforms list" gemSet (
set:
functions.filterGemset {
inherit ruby;
groups = [ ];
} set == gemSet
)
)
(
let
gemSet = {
test = {
platforms = [
{
engine = ruby.rubyEngine;
version = ruby.version.majMin;
}
];
};
};
in
test.run "Filter matches on platform" gemSet (
set:
functions.filterGemset {
inherit ruby;
groups = [ ];
} set == gemSet
)
)
(
let
gemSet = {
test = {
groups = [
"x"
"y"
];
};
};
in
test.run "Filter excludes based on groups" gemSet (
set:
functions.filterGemset {
inherit ruby;
groups = [
"a"
"b"
];
} set == { }
)
)
]