1 { lib, ruby, defaultGemConfig, test, should }:
5 gemConfig = defaultGemConfig;
7 functions = (import ./functions.nix testConfigs);
10 ( test.run "All set, no gemdir" (functions.bundlerFiles {
11 gemfile = test/Gemfile;
12 lockfile = test/Gemfile.lock;
13 gemset = test/gemset.nix;
15 gemfile = should.equal test/Gemfile;
16 lockfile = should.equal test/Gemfile.lock;
17 gemset = should.equal test/gemset.nix;
20 ( test.run "Just gemdir" (functions.bundlerFiles {
23 gemfile = should.equal test/Gemfile;
24 lockfile = should.equal test/Gemfile.lock;
25 gemset = should.equal test/gemset.nix;
28 ( test.run "Gemset and dir" (functions.bundlerFiles {
30 gemset = test/extraGemset.nix;
32 gemfile = should.equal test/Gemfile;
33 lockfile = should.equal test/Gemfile.lock;
34 gemset = should.equal test/extraGemset.nix;
37 ( test.run "Filter empty gemset" {} (set: functions.filterGemset {inherit ruby; groups = ["default"]; } set == {}))
38 ( let gemSet = { test = { groups = ["x" "y"]; }; };
40 test.run "Filter matches a group" gemSet (set: functions.filterGemset {inherit ruby; groups = ["y" "z"];} set == gemSet))
41 ( let gemSet = { test = { platforms = []; }; };
43 test.run "Filter matches empty platforms list" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet))
44 ( let gemSet = { test = { platforms = [{engine = ruby.rubyEngine; version = ruby.version.majMin;}]; }; };
46 test.run "Filter matches on platform" gemSet (set: functions.filterGemset {inherit ruby; groups = [];} set == gemSet))
47 ( let gemSet = { test = { groups = ["x" "y"]; }; };
49 test.run "Filter excludes based on groups" gemSet (set: functions.filterGemset {inherit ruby; groups = ["a" "b"];} set == {}))