{
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"
gemdir = test/.;
(test.run "Gemset and dir"
gemset = test/extraGemset.nix;
gemset = should.equal test/extraGemset.nix;
(test.run "Filter empty gemset" { } (
set:
functions.filterGemset {
inherit ruby;
groups = [ "default" ];
} set == { }
))
(
gemSet = {
test = {
groups = [
"x"
"y"
];
test.run "Filter matches a group" gemSet (
"z"
} set == gemSet
platforms = [ ];
test.run "Filter matches empty platforms list" gemSet (
groups = [ ];
platforms = [
engine = ruby.rubyEngine;
version = ruby.version.majMin;
test.run "Filter matches on platform" gemSet (
test.run "Filter excludes based on groups" gemSet (
"a"
"b"
]